/**
 * @fileoverview The page system: the scale, inks, surfaces, grid and the handful of parts every page outside the
 * Map's canvas is made of (the bar, a page and its head, a filter bar, a card, a section head, a list row, a detail
 * sheet, a list of facts, a tag, a button, a segmented control, a field, a menu).
 *
 * @custody Owns how those parts look and how dense they are. Does not own a page's words, order or behaviour, the
 *   Map's stage, or the marks (web/system/marks.css, session-state.css), which it only places.
 * @intent A working tool that reads as levels: a page's head, a detail's title, what a row is about, what describes
 *   it, and the labels over a section, each one step of one scale apart, so a page holds its structure at a squint
 *   (four sizes within 4 px read as one grey texture). The tempting wrong edits: a sixth size, or a 13 or a 15 to make
 *   one thing fit (give it a level's size, or a weight or an ink inside one), a fourth style inside one row, a control
 *   with no face at rest, a fill where a line would do, and a column that one row sets for itself.
 * @invariants Five sizes (12, 14, 16, 20, 24), one job each, and three weights (400, 500, 600). Two inks for words (the
 *   subject, and all meta), each at least 4.5:1 on every surface it stands on. Three text styles inside one row. The
 *   first line of a row stands on one baseline, pills and tags included. Each thing is said once: a row never
 *   repeats the head it stands under, and a detail never restates its row. Every control has a face or an edge at rest, a face when pointed at and pressed, and a ring when
 *   focused by the keyboard. A row's columns are its page's, never its own.
 */

/* ── Tokens ───────────────────────────────────────────────────────────────────────────────────────────────────── */

:root {
  /* Type, as `font` values: weight, size over line, family. Five sizes, one level each, and nothing between them:
       24  a page's head, one on a page: its state in plain words, or its name where it has none
       20  a title: what a detail, a panel or a state is, one at a time
       16  what a row is about: a session, a goal, an area, a machine (500); words being written (400)
       14  the body and all meta: a sentence to read and words someone wrote (400, the first ink); ages, what
           happened, where, counts, a fact's label (400, the second ink); a fact's value and a control's label
           (the primary ink, a control at 500)
       12  labels: a section's or a card's label (600, capitals, tracked, the second ink), a pill, a tag, the
           literal face
     A row holds three of these and no more: its name, its meta, its labels, so it reads 16 over 14 over 12. */
  --text-page: 600 24px/32px var(--type-body-family);
  --text-title: 600 20px/28px var(--type-body-family);
  --text-name: 500 16px/24px var(--type-body-family);
  --text-body: 400 14px/20px var(--type-body-family);
  --text-meta: 400 14px/20px var(--type-body-family);
  --text-control: 500 14px/20px var(--type-body-family);
  --text-label: 500 12px/16px var(--type-body-family);
  /* A section's or a card's label: in capitals and tracked wherever it stands as one (`--case-head-label`,
     `--track-head-label`), so twelve pixels hold the structure of the page without growing. A pill and a person's
     initials share its weight and size, never its case or tracking. */
  --text-head-label: 600 12px/16px var(--type-body-family);
  --case-head-label: uppercase;
  /* A group headed by a name someone gave (an area, a goal, a repository, a machine, a session): the name in its own
     case, 14/600 in the first ink, no capitals and no tracking (`.hive-section__head--name`, `.hive-card__head--name`).
     Capitals would turn a lower-case repository into a word its owner never wrote; they are for the product's own
     labels alone (Waiting on you, Areas, Told to). */
  --text-group: 600 14px/20px var(--type-body-family);
  --text-literal: 500 12px/16px var(--type-data-family);
  /* Tracking follows size: tighter as it grows, a little air at 12, more for capitals. */
  --track-24: -0.02em;
  --track-20: -0.014em;
  --track-16: -0.011em;
  --track-12: 0.012em;
  --track-head-label: 0.05em;

  /* Inks: the subject, and everything that describes it. A third tone is for marks that are not read (a separator,
     a chevron at rest) and for what is disabled; it is never the colour of words a person must read. */
  --ink-1: #ededed;
  --ink-2: #a0a0a0;
  --ink-quiet: #6e6e6e;

  /* Surfaces, darkest first: the ground, a card, a face pointed at or raised, a face chosen or pressed. */
  --surface-0: #141414;
  --surface-1: #1a1a1a;
  --surface-2: #1f1f1f;
  --surface-3: #262626;
  --face-quiet: rgb(255 255 255 / 0.055);
  --face-quiet-hover: rgb(255 255 255 / 0.09);
  --face-quiet-press: rgb(255 255 255 / 0.13);
  /* A chosen option of a few, raised over its track (#141414) so it is told at a quarter size (judged on pictures:
     #262626 and #2e2e2e read as its neighbours' ink only). */
  --face-segment-chosen: #3e3e3e;
  /* The primary's face is the product's (web/system/tokens.css `--face-primary`): every surface reads it, a phone's
     screen and its sheets included, whether or not it loads this sheet. */
  /* Lines: a card's edge, a separator inside it, a control's edge. */
  --line: rgb(255 255 255 / 0.09);
  --line-strong: rgb(255 255 255 / 0.13);
  --line-soft: rgb(255 255 255 / 0.06);
  --line-control: rgb(255 255 255 / 0.17);

  --corner-card: 10px;
  --corner-control: 8px;
  --corner-tag: 6px;

  /* The page column: the bar and every page share its two edges, the window's own less the gutter, at every width.
     (A 1280 px cap put every page's edges 136 px inside the bar's at a 1552 px window.) A list takes the width; a
     detail stays 400 px at the right edge, where the Map's pane stands. */
  --page-max: 100%;
  --page-gutter: 24px;
  /* The detail beside a list: 400 px, never under 320, 16 px from it. */
  --detail-width: 400px;
  --detail-min-width: 320px;
  --frame-gap: 16px;
  /* The column frame's measure (`.hive-page--column`, `.hive-page__measure`): one centred column for the Queue,
     Decisions and the Exchanges list, its head on the same measure, so no card is pushed left on an empty field. */
  --page-measure: 880px;
  --bar-h: 48px;
}

@media (max-width: 759.98px) {
  :root {
    --page-gutter: 16px;
    --bar-h: 52px;
  }
}

/* ── The bar ──────────────────────────────────────────────────────────────────────────────────────────────────── */

.hive-bar {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  background: var(--surface-0);
  box-shadow: inset 0 -1px 0 var(--line);
}

.hive-bar__inner {
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  gap: 16px;
  max-inline-size: var(--page-max);
  block-size: var(--bar-h);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.hive-bar__lead,
.hive-bar__end {
  display: flex;
  align-items: center;
  gap: 12px;
  min-inline-size: 0;
}
.hive-bar__end { margin-inline-start: auto; gap: 12px; }

.hive-bar__brand {
  font: var(--text-name);
  font-weight: 600;
  color: var(--ink-1);
  text-decoration: none;
}

.hive-bar__rule {
  inline-size: 1px;
  block-size: 16px;
  background: var(--line-control);
}

.hive-bar__tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-inline-start: 8px;
}

.hive-bar__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 10px;
  font: var(--text-name);
  color: var(--ink-2);
  text-decoration: none;
  transition: color 100ms ease-out;
}
.hive-bar__tab:hover { color: var(--ink-1); }
.hive-bar__tab[aria-current='page'] { color: var(--ink-1); }
.hive-bar__tab[aria-current='page']::after {
  content: '';
  position: absolute;
  inset: auto 10px 0;
  block-size: 2px;
  background: var(--ink-you);
}
.hive-bar__tab:focus-visible { outline: 2px solid var(--ink-1); outline-offset: -2px; border-radius: var(--corner-control); }

.hive-bar__coverage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--text-control);
  color: var(--ink-notice);
}

.hive-bar__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: var(--text-meta);
  color: var(--ink-2);
}

/* ── A page: the column, and its head ─────────────────────────────────────────────────────────────────────────── */

.hive-page {
  box-sizing: border-box;
  max-inline-size: var(--page-max);
  margin-inline: auto;
  padding: 0 var(--page-gutter) 48px;
  font: var(--text-body);
  color: var(--ink-2);
}

/* A page opens with its head: its state in plain words as the page's one large line (`__title`: "2 sessions are
   waiting on you", "Nothing is waiting on you"), or the page's name where it has no state; a quiet line of what else
   is true beside it (`__state`); and the page's controls and its one action at the line's end (`__tools`). State is
   not explanation: the head never says how to use the page. Every page's first card stands at one height under it. */
.hive-page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 8px 16px;
  min-block-size: 32px;
  padding-block: 20px 16px;
}
.hive-page__head:empty { min-block-size: 0; padding-block: 16px 0; }
.hive-page__title {
  margin: 0;
  font: var(--text-page);
  letter-spacing: var(--track-24);
  color: var(--ink-1);
  text-wrap: balance;
}
.hive-page__state { margin: 0; font: var(--text-meta); color: var(--ink-2); }
/* A page that holds less than its width (nothing yet, or one short line) keeps its head and its one action together
   at the left: at the far edge, 1,700 px from the words it belongs to, the action read as part of the bar. Inside the
   column frame the head is the column's own width, so its one action stands at its right end, as on every page. */
.hive-page__head--alone > .hive-page__tools { margin-inline-start: 0; }
:is(.hive-page__measure, .hive-page--column) > .hive-page__head--alone > .hive-page__tools { margin-inline-start: auto; }

.hive-page__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 8px;
  margin-inline-start: auto;
}

/* ── The column frame: a list and its rail, at the gutter ──────────────────────────────────────────────────────── */
/* Every page's head starts at the page's 24 px gutter, the edge the Map's strip, the Record and Setup start on, so the
   head never moves when the reader changes tabs. A page is one of two shapes there: a list with its rail (the Queue,
   Decisions, the Exchanges list: this frame) or a table with its rail (Setup). This frame is `.hive-page--column`, or
   any page whose split's list is a `.hive-page__measure`:
     the list column is `--page-measure` (880 px), then `--frame-gap` (16), then the rail (`--detail-width`, 400; never
     under `--detail-min-width`, 320), all from the gutter; the head is the list column's width, its title at the
     column's left edge and its one action at its right edge;
     the column never moves: with nothing open it stands alone at the gutter and the rail's place is empty ground;
     opening a detail fills the rail, and nothing slides or reflows. (`.hive-page--pair` only said a filled rail; the
     frame no longer needs to know, so it is retired: no page used it.)
   Where column and rail do not fit between the gutters the column narrows and the rail keeps 320 to 400 px. A phone
   keeps one column at the gutter. A lone `.hive-page__measure` (a page with nothing but its column, the Exchanges list
   empty) is the same column at the gutter.
   A centred column, with a 208 px slide of the pair when a detail opened, was tried on 26 November and withdrawn: the
   head stood at 24, 128 or 336 px by tab, so it jumped under the reader as he moved between pages. */
.hive-page__measure { box-sizing: border-box; inline-size: 100%; max-inline-size: var(--page-measure); margin-inline: 0; }
@media (min-width: 760px) {
  :is(.hive-page--column, .hive-page:has(> .hive-split > .hive-page__measure)) {
    /* The rail and the column, against the page's own content box (`cqi`): the same widths open or closed. */
    container: page-frame / inline-size;
    --frame-rail: clamp(var(--detail-min-width), calc(100cqi * 0.4), var(--detail-width));
    --frame-column: min(var(--page-measure), calc(100cqi - var(--frame-gap) - var(--frame-rail)));
    max-inline-size: none;
  }
  :is(.hive-page--column, .hive-page:has(> .hive-split > .hive-page__measure)) > .hive-page__head {
    box-sizing: border-box;
    inline-size: var(--frame-column);
    margin-inline: 0;
  }
  :is(.hive-page--column, .hive-page:has(> .hive-split > .hive-page__measure)) > .hive-split {
    grid-template-columns: var(--frame-column) var(--frame-rail);
    justify-content: start;
  }
}

/* A list and the detail of what is chosen in it: the detail is one column at the page's right edge, 400 px from a
   1056 px window up and never under 320, so on a narrow desk the list keeps more than it gives. */
.hive-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(var(--detail-min-width), 40%, var(--detail-width));
  align-items: start;
  gap: var(--frame-gap);
}

/* ── The filter bar: the kinds in their fixed order, each with its count ───────────────────────────────────────── */

/* One control: a rail that holds every kind in its fixed order, each a short fixed word with its count. The full
   words are each kind's accessible name and its title. The rail is its line's whole width (the page's column), 32 px
   tall as the choice of a few is, and holds what is asked for less often at its end, inside its edge
   (`__end`). Where it is narrower than its kinds it takes a second line inside the same edge. */
.hive-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  inline-size: 100%;
  max-inline-size: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--corner-card);
  background: var(--surface-1);
  list-style: none;
}
.hive-filter > li { display: contents; }

.hive-filter__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  block-size: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: var(--text-control);
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 100ms ease-out, color 100ms ease-out;
}
/* A count's place has one width, whatever stands in it (two figures, or a figure and its plus), so a kind keeps its
   width from unknown to 99 and no kind moves when its number lands: 18 px holds two tabular figures at 14. */
.hive-filter__count {
  min-inline-size: 18px;
  font: var(--text-meta);
  font-feature-settings: 'lnum' 1, 'tnum' 1;
  color: var(--ink-2);
}
.hive-filter__end { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-inline-start: auto; }
.hive-filter__end > .hive-button { block-size: 26px; padding-inline: 10px; border-radius: 7px; }
.hive-filter__item:hover { background: var(--face-quiet-hover); color: var(--ink-1); }
.hive-filter__item:active { background: var(--face-quiet-press); }
/* Where a count cannot be given, its place holds a mark that is never a figure: coverage's own mark in coverage's
   amber for `not reported` (a 0 would be a claim); a proven minimum with a plus; and, where nothing is known yet
   (`--unknown`, the element empty), one quiet stroke of the count's own width, never `0+`. The words are in the
   kind's accessible name and its title. A section head's count that is not yet known is the same stroke. */
.hive-filter__count--not-reported { display: inline-grid; color: var(--ink-notice); }
.hive-filter__item[aria-pressed='true'] .hive-filter__count--not-reported { color: inherit; }
/* The stroke's box is an inline box with the text's own strut, so it stands on the line's baseline beside the words,
   and the stroke on the figures' middle, where a dash in the text would be (a box with no text of its own sat on the
   baseline in a section head and read as an underscore). */
.hive-filter__count--unknown,
.hive-section__count--unknown { display: inline-block; min-inline-size: 18px; }
.hive-filter__count--unknown::before,
.hive-section__count--unknown::before { content: ''; display: inline-block; vertical-align: middle; inline-size: 8px; block-size: 2px; border-radius: 1px; background: var(--ink-quiet); }
.hive-filter__item[aria-pressed='true'] .hive-filter__count--unknown::before { background: currentColor; }
/* A kind with nothing in it keeps its place and its width and says no figure: its words centred in the room its
   count took (8 + (6 + 18) / 2 = 20), in the second ink (the quiet ink is 3.4:1 on the card and is not for words). */
.hive-filter__item[data-empty] { color: var(--ink-2); padding-inline: 20px; }
.hive-filter__item[data-empty] .hive-filter__count { display: none; }
/* The chosen kind is cream, as what is chosen is everywhere. */
.hive-filter__item[aria-pressed='true'] {
  background: var(--ink-you);
  color: var(--ink-on-filled);
}
.hive-filter__item[aria-pressed='true'] .hive-filter__count { color: color-mix(in srgb, var(--ink-on-filled) 72%, transparent); }
.hive-filter__item:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }

/* ── A card, and a section inside it ──────────────────────────────────────────────────────────────────────────── */

.hive-card {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--corner-card);
  background: var(--surface-1);
  container: card / inline-size;
}

/* A card's own first line, 40 px with or without its action, in one of two forms. `__head` names the card: its title
   as a section's label, an optional count, and the card's one action (the small edged button) at the line's end.
   `__top` is a sentence where a page has something to say before its first section: what awaits the reader, and the
   page's one action at the line's end. In both the words and the action's label stand on one baseline (the line
   aligns them; nothing is centred against anything), and the action ends on the card's 16 px inset, where every
   row's last word ends. */
.hive-card__top,
.hive-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 4px 12px;
  min-block-size: 40px;
  box-sizing: border-box;
  padding: 4px 16px;
  font: var(--text-meta);
  color: var(--ink-2);
}
.hive-card__head {
  column-gap: 8px;
  font: var(--text-head-label);
  letter-spacing: var(--track-head-label);
  text-transform: var(--case-head-label);
}
.hive-card__top > strong { font: var(--text-control); color: var(--ink-1); }
.hive-card__top-end,
.hive-card__head-end { display: inline-flex; align-items: baseline; gap: 8px; margin-inline-start: auto; }
/* A head's words take its case and tracking, whatever element or type role a page gives its name (a title role
   sets its own case, and kept the head's label in small letters). What ends a head (its one action, an owner, a
   person) is not the label: its own case and spacing, for it and for everything in it. */
:is(.hive-card__head, .hive-section__head, .hive-detail__label) :where(*) { letter-spacing: inherit; text-transform: inherit; }
:is(.hive-card__head-end, .hive-section__end) { letter-spacing: normal; text-transform: none; }
:is(.hive-card__top, .hive-card__head) + .hive-section > .hive-section__head { padding-block-start: 20px; border-block-start: 1px solid var(--line-strong); }
/* A section with no rows is its head alone, one 40 px line (12, the words, 12), and the head after it stands 12 px
   under its rule as a row would, not the 20 px that part a section's rows from the next head: an empty list is then an
   even stack of lines (it read as three bands of 49, 58 and 68 px). A notice that holds a control is a 40 px line too. */
/* Only a section that is shown and is truly its head alone: one that is hidden, or has no head (a holder some page
   put between a card's head and its first section), changes nothing for the section after it. */
.hive-section:not([hidden]):has(> .hive-section__head):not(:has(> :not(.hive-section__head, :empty, [hidden]))) > .hive-section__head { padding-block: 12px; }
.hive-section:not([hidden]):has(> .hive-section__head):not(:has(> :not(.hive-section__head, :empty, [hidden]))) + .hive-section > .hive-section__head { padding-block-start: 12px; }
.hive-notice:has(> .hive-button) { padding-block: 4px; }
/* A card ends 17 px under its last words, as it starts 17 px before its first: under a row of words someone wrote,
   and under a head that has no rows (an area with nothing in it yet). */
.hive-card > .hive-section:last-child:has(.hive-item--statement) { padding-block-end: 6px; }
.hive-card > .hive-section:last-child > .hive-section__head:last-child { padding-block-end: 16px; }

/* A section's head is words, not a band. A stronger rule stands over it, the full width, with 20 px between the rule
   and the words and 8 px between the words and their first row: the head belongs to what follows it. */
.hive-section__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 16px 8px;
  font: var(--text-head-label);
  letter-spacing: var(--track-head-label);
  text-transform: var(--case-head-label);
  color: var(--ink-2);
}
.hive-section + .hive-section > .hive-section__head {
  padding-block-start: 20px;
  border-block-start: 1px solid var(--line-strong);
}
/* Rows with no head of their own (what waits on the reader) are parted from the section after them the same way. */
.hive-section:not(:has(> .hive-section__head)) + .hive-section > .hive-section__head { margin-block-start: 0; }
.hive-section__name { margin: 0; font: inherit; letter-spacing: inherit; }
/* A head that is a row of one flat list: the same words under the same rule, and its first row draws no rule. */
.hive-list > .hive-section__head:not(:first-child) { padding-block-start: 20px; border-block-start: 1px solid var(--line-strong); }
.hive-list > .hive-section__head + .hive-item { background-image: none; }
.hive-section__count { font-weight: 500; font-feature-settings: 'lnum' 1, 'tnum' 1; letter-spacing: var(--track-12); }
/* A head that is a name (see `--text-group`): the same place, rule and spacing as a label's head, the name in its own
   case and the first ink, its count beside it in the second ink. */
:is(.hive-section__head--name, .hive-card__head--name) {
  font: var(--text-group);
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-1);
}
:is(.hive-section__head--name, .hive-card__head--name) :is(.hive-section__count, .hive-section__end, .hive-card__head-end) { color: var(--ink-2); letter-spacing: normal; }
:is(.hive-section__head--name, .hive-card__head--name) .hive-section__name > .hive-person { margin-block: -1px; }
.hive-section__end { display: inline-flex; align-items: baseline; gap: 6px; margin-inline-start: auto; font-weight: 500; }
.hive-section__end > svg { color: var(--ink-quiet); align-self: center; }

.hive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── A list row ───────────────────────────────────────────────────────────────────────────────────────────────── */
/* One line, 40 px (8, the name's 24 px line, 8), at every desk width: the age in a column as wide as its widest value (plain
   figures whether or not it waits on the reader; the mark says that), the kind's mark, the name of the thing, what happened, then where. Three text styles: the
   name, the meta, a label. Everything on the first line stands on one baseline; the mark is centred on that line.
   Each thing is said once: no clock beside an age, no program a name already says, no kind the head above says.

   Where a row is short of room its parts give way in one order, and none is ever cut mid-phrase:
     1. where: the tab and its window leave first, whole, and the program stays;
     2. what happened: its fixed words show whole or not at all (the kind's mark and the detail still say it);
     3. the name, last, and only when both are gone: cut at the line's end.
   No script measures anything. The name's column takes what the name and what happened need before where gets
   any; inside each, a part that does not fit wraps to a second line that the row's one line does not show. */

.hive-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--item-columns, 48px 18px minmax(0, max-content) minmax(0, 1fr));
  align-items: baseline;
  align-content: center;
  column-gap: 8px;
  min-block-size: 40px;
  box-sizing: border-box;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 100ms ease-out;
}
/* The rule between two rows starts at the name's column, so the ages and marks read as one margin down the list. */
.hive-list > li + li > .hive-item,
.hive-list > .hive-item + .hive-item {
  background-image: linear-gradient(var(--line-soft), var(--line-soft));
  background-repeat: no-repeat;
  background-position: var(--item-rule-start, 16px) 0;
  background-size: 100% 1px;
}
.hive-item:hover { background-color: var(--surface-2); }
.hive-item:active { background-color: var(--surface-3); }
.hive-item:focus-visible { outline: 2px solid var(--ink-1); outline-offset: -2px; }
/* The chosen row: a face, and the cream edge that says chosen. `data-open` is a row whose own link is the one open. */
.hive-item[aria-current='true'],
.hive-item[aria-selected='true'],
.hive-item[data-open='true'] { background-color: var(--surface-3); }
.hive-item[aria-current='true']::before,
.hive-item[aria-selected='true']::before,
.hive-item[data-open='true']::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  inline-size: 2px;
  background: var(--ink-you);
}

.hive-item__age {
  justify-self: end;
  font: var(--text-meta);
  font-feature-settings: 'lnum' 1, 'tnum' 1;
  color: var(--ink-2);
  white-space: nowrap;
}
/* A count in red (a tab's or a list's number of what waits on the reader): the pill, as the bar's badge is. A pill and
   a tag are one height. It never holds an age. */
.hive-pill {
  display: inline-block;
  min-inline-size: 20px;
  block-size: 20px;
  box-sizing: border-box;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--ink-waiting-on-you);
  font: var(--text-head-label);
  line-height: 20px;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
  letter-spacing: 0;
  color: var(--ink-on-waiting-on-you);
  text-align: center;
  white-space: nowrap;
}

/* How long something has waited on the reader is an age like any other: the same figures, ink and place in the age
   column, so a column of ages reads as one. Red stays the word for waiting on the reader, but it does not count hours:
   it is on the row's mark (`__mark--on-you`) and on a count's disc. A 21-hour age filled red read as an alarm. */
.hive-item__age--on-you { color: var(--ink-2); }
/* The product's own age mark (marks.css `.hive-age`), where a row's age is one, takes the row's type and ink. */
.hive-item > .hive-age.hive-item__age { display: block; color: var(--ink-2); }
/* A row that is not itself a target (it opens nothing, or only its lines do): no face when pointed at. */
.hive-item--still { cursor: default; }
.hive-item--still:hover,
.hive-item--still:active { background-color: transparent; }
/* What Hive saw, inside a row's words, is in the literal face at the literal size. */
.hive-item :is(.hive-item__name, .hive-item__kind, .hive-item__sentence) code { font: var(--text-literal); color: inherit; }
/* One line of meta under a row's name. */
.hive-item > .hive-meta { grid-column: 3 / -1; margin-block-start: 2px; }

/* The mark: 16 px drawn, centred on the first line (the name's 24 px line), whatever the row's height. */
.hive-item__mark {
  align-self: start;
  display: grid;
  place-items: center;
  inline-size: 18px;
  block-size: 24px;
  color: var(--ink-2);
}

.hive-item__main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  min-inline-size: 0;
  block-size: 24px;
  overflow: hidden;
}
.hive-item__main:has(> .hive-item__name--whole) { block-size: auto; overflow: visible; }
.hive-item__name {
  flex: 0 1 auto;
  min-inline-size: 0;
  max-inline-size: 100%;
  overflow: hidden;
  font: var(--text-name);
  letter-spacing: var(--track-16);
  color: var(--ink-1);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hive-item__name--none { color: var(--ink-2); font-weight: 400; }
.hive-item__kind {
  flex: none;
  font: var(--text-meta);
  color: var(--ink-2);
  white-space: nowrap;
}

/* The second line: a question someone wrote, whole or cut after a whole word by its page, at the name's size and ink
   in the reading weight (words someone asked are what the row is about). */
.hive-item__sentence {
  grid-column: 3 / -1;
  margin: 2px 0 0;
  font: var(--text-name);
  font-weight: 400;
  letter-spacing: var(--track-16);
  color: var(--ink-1);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

/* Where: the program stays and the tab is the part that leaves. The markup is in reading order (the tab, the machine,
   the program) and the line is laid from the row's end with the last part first, so the last part stands at the end
   and is kept longest; a part that cannot share the line, the first, wraps to a second line that the row does not
   show (its 20 px box stands inside the name's 24 px line, on the name's baseline). A row with nothing to say here has
   no cell at all, so it sets no baseline. */
.hive-item__where {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  min-inline-size: 0;
  block-size: 20px;
  overflow: hidden;
  margin-inline-start: 4px;
  font: var(--text-meta);
  line-height: 20px;
  color: var(--ink-2);
  white-space: nowrap;
}
.hive-item__where > * { flex: none; }
.hive-item__where > :nth-last-child(1) { order: 1; }
.hive-item__where > :nth-last-child(2) { order: 2; }
.hive-item__where > :nth-last-child(3) { order: 3; }
.hive-item__where > :nth-last-child(4) { order: 4; }
.hive-item__where:empty { display: none; }
/* The program, in a column of its own so every row's ends on one edge and starts on another: as wide as the longest
   program's name at the meta size (`Claude Code` at 14 is 87 px; at 84 its last letter was cut). */
.hive-item__program { inline-size: 96px; text-align: start; }

/* A row that holds several, closed: a chevron where its mark would be. */
.hive-item__mark--fold { color: var(--ink-quiet); }
/* A mark that waits on the reader is red, wherever it is drawn: a desk row's mark cell (over the cell's second ink
   and a fold's quiet ink, so it is written with both classes and stands after both), and a phone row's mark, where the
   class is on the mark itself. Placed before `.hive-item__mark`, one class against one, it lost and no desk mark was
   ever red. */
.hive-item__mark.hive-item__mark--on-you,
.hive-item__mark--on-you { color: var(--ink-waiting-on-you); }

/* A row that also holds something else to press (a machine to narrow to, the rows it opens to, a second session):
   the row is the container and `__link` is its one target, whose press area is the whole row. What else can be pressed
   stands above that area. The row answers to its link: pointed at, pressed, focused. */
.hive-item:has(> .hive-item__link) { cursor: default; }
.hive-item:has(> .hive-item__link):hover { background-color: transparent; }
.hive-item:has(> .hive-item__link):active { background-color: transparent; }
.hive-item__link {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.hive-item__link::after { content: ''; position: absolute; inset: 0; }
.hive-item:has(> .hive-item__link:hover) { background-color: var(--surface-2); }
.hive-item:has(> .hive-item__link:active) { background-color: var(--surface-3); }
.hive-item[data-open='true']:has(> .hive-item__link) { background-color: var(--surface-3); }
.hive-item__link:focus-visible { outline: none; }
.hive-item:has(> .hive-item__link:focus-visible) { outline: 2px solid var(--ink-1); outline-offset: -2px; }
.hive-item__lines,
.hive-item > .hive-list--within { position: relative; z-index: 1; }
/* A control inside a row: its words in the row's own meta style, a face when it is pointed at. */
.hive-item__control {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin: -2px -6px;
  padding: 2px 6px;
  border: 0;
  border-radius: var(--corner-tag);
  background: transparent;
  font: inherit;
  color: inherit;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.hive-item__control > svg { align-self: center; }
.hive-item__control:hover { background: var(--face-quiet-hover); color: var(--ink-1); }
.hive-item__control:active { background: var(--face-quiet-press); }
.hive-item__control:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 0; }

/* A name that is a headline is never cut: it takes the lines it needs. */
.hive-item__name--whole { white-space: normal; overflow: visible; text-wrap: pretty; }

/* A row opened in place: its chevron turns, and its rows stand under it on the ground's own tone, each a row of
   the same columns, so what is inside reads as inside. */
.hive-item[aria-expanded='true'] .hive-item__mark--fold > svg,
.hive-item:has(> [aria-expanded='true']) > .hive-item__mark--fold > svg { rotate: 180deg; }
/* Inside a row that is the container, the rows it opens to run the row's full width under its line. */
.hive-item > .hive-list--within { grid-column: 1 / -1; margin: 8px -16px -8px; }
.hive-list--within {
  background: var(--surface-0);
  box-shadow: inset 0 1px 0 var(--line-soft);
}
.hive-list--within .hive-item__name { font-weight: 400; }
/* The rest of a list that shows only its first few: one quiet row, the name's column. */
.hive-item--more .hive-item__name { font: var(--text-meta); color: var(--ink-2); }

/* Lines under a row that are each a thing of their own (the two sessions of an overlap): a chip and a name, each
   a link, in the meta style. */
.hive-item__lines {
  grid-column: 3 / -1;
  display: grid;
  gap: 4px;
  margin: 6px 0 2px;
  padding: 0;
  list-style: none;
  font: var(--text-meta);
  color: var(--ink-2);
}
.hive-item__line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
.hive-item__line:hover { color: var(--ink-1); }

/* What Hive saw, under a row's name: the file a session touched, whole, in the literal face. */
.hive-item > .hive-literal { grid-column: 3 / -1; margin-block-start: 2px; }
.hive-item--stacked > .hive-literal { grid-column: 2; }

/* A line of meta: items parted by a centred dot. The dot belongs to the item after it and stands in that item's own
   leading space; the line is clipped at its first edge, so a line that wraps never opens with a dot. The clip leaves
   4 px above and below the line, where a person's chip (22 px on a 20 px line) stands past it. An age is an item of
   the line like any other, whether or not it waits on the reader. */
.hive-meta {
  --meta-gap: 15px;

  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 2px;
  min-inline-size: 0;
  margin-block: 0;
  margin-inline-start: calc(-1 * var(--meta-gap));
  font: var(--text-meta);
  color: var(--ink-2);
  clip-path: inset(-4px 0 -4px var(--meta-gap));
}
.hive-meta > * { position: relative; padding-inline-start: var(--meta-gap); }
.hive-meta > *::before {
  content: '·';
  position: absolute;
  inset-inline-start: 0;
  inline-size: var(--meta-gap);
  color: var(--ink-quiet);
  text-align: center;
}
/* A pill or a tag in the line is an object, not a word in the run: 8 px on either side of it and never a dot, before
   it or after. It keeps its own shape (the space before it is a margin, not its padding), and it keeps the line's
   15 px lead, so one that opens a wrapped line is not cut by the line's clipped edge; the 8 px are made by drawing
   its neighbours 7 px nearer. */
.hive-meta > :is(.hive-pill, .hive-tag) { margin-inline: var(--meta-gap) -7px; padding-inline-start: 6px; }
.hive-meta > :has(+ :is(.hive-pill, .hive-tag)) { margin-inline-end: -7px; }
.hive-meta > :is(.hive-pill, .hive-tag)::before,
.hive-meta > :is(.hive-pill, .hive-tag) + *::before { content: none; }

/* A row on a phone, and a row in a detail: the mark and the name on the first line, with the name the column's whole
   width from 44 px; under it one line of meta that begins with the age. A question's words follow. */
.hive-item--stacked {
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 2px;
  padding-block: 10px;
}
.hive-item--stacked > .hive-item__name { white-space: normal; overflow: visible; }
.hive-item--stacked > :is(.hive-meta, .hive-item__sentence, .hive-item__lines, .hive-item__tags) { grid-column: 2; }
.hive-item--stacked > .hive-item__tags { margin-block-start: 4px; }

/* A row whose subject is words someone wrote: the words, at most two lines here and whole when opened, over its
   tags and one line of meta. Where the two do not share a line, the tags keep theirs and the meta takes the next. */
.hive-item--statement {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 6px;
  padding-block: 10px;
}
.hive-item__words {
  max-inline-size: 640px;
  margin: 0;
  /* What the row is about: the name's size, in the reading weight, as the field it was written in sets it. */
  font: var(--text-name);
  font-weight: 400;
  letter-spacing: var(--track-16);
  color: var(--ink-1);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.hive-item__words--none { color: var(--ink-2); }
/* Words read whole in their row (a list that cuts nothing): every line they need, broken only between words (a single
   string longer than the line breaks where it must), the row growing to hold them; the tags and the meta stay under
   the last line. */
.hive-item__words.hive-item__words--whole {
  display: block;
  -webkit-line-clamp: none;
  line-clamp: none;
  overflow: visible;
  overflow-wrap: break-word;
}
.hive-item__under {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-inline-size: 0;
}
/* The tags stand 14 px under the words' last line, not on the words' own pitch, so they do not read as a third line. */
.hive-item--statement > .hive-item__under { margin-block-start: 8px; }
.hive-item__tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ── The detail: a sheet beside the list ──────────────────────────────────────────────────────────────────────── */

.hive-detail {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--corner-card);
  background: var(--surface-1);
  font: var(--text-meta);
  color: var(--ink-2);
}

/* The detail's parts inside a column that is already a card (the Queue's open item, which scrolls inside its own
   column): the same parts, no second edge. */
.hive-detail--bare { padding: 0; border: 0; border-radius: 0; background: none; }

/* The head: the title first, with how long it has waited at its line's end when it waits on the reader, then one line
   of meta.
   One title style and one weight (600), whatever is opened: a session's name or the words of a decision. */
.hive-detail__head {
  display: grid;
  gap: 6px;
}
.hive-detail__top {
  display: flex;
  align-items: baseline;
  gap: 8px 12px;
}
.hive-detail__top > .hive-pill { flex: none; margin-inline-start: auto; }
.hive-detail__title {
  margin: 0;
  min-inline-size: 0;
  font: var(--text-title);
  letter-spacing: var(--track-20);
  color: var(--ink-1);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
/* The word of last resort where what is opened has no name of its own (`Codex`, `Unnamed checkout`): the title's size
   and place, so the pill's line and the line under it stand where they always stand, in the quiet ink at the reading
   weight, as a row sets the same word (`.hive-item__name--none`). */
.hive-detail__title--none { font-weight: 400; color: var(--ink-2); }
.hive-detail__state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin: 0;
  font: var(--text-meta);
  color: var(--ink-2);
}
.hive-detail__state > strong { font: inherit; color: var(--ink-1); }
.hive-detail__by {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font: var(--text-meta);
  color: var(--ink-2);
}
.hive-detail__words {
  margin: 0;
  font: var(--text-body);
  color: var(--ink-1);
  text-wrap: pretty;
}
.hive-detail__group { display: grid; gap: 8px; }
.hive-detail__label {
  margin: 0;
  font: var(--text-head-label);
  letter-spacing: var(--track-head-label);
  text-transform: var(--case-head-label);
  color: var(--ink-2);
}
.hive-detail__rule { block-size: 1px; margin-inline: -16px; background: var(--line-soft); }
.hive-detail__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 -16px -16px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 var(--line-soft);
}
.hive-detail__foot > .hive-detail__foot-end { margin-inline-start: auto; display: inline-flex; gap: 8px; }

/* Rows inside a detail: the same row, its name over its meta, and no rule between two of them. In a detail only the
   sections are ruled. */
.hive-detail .hive-list { margin-inline: -16px; }
.hive-detail .hive-list > li + li > .hive-item { background-image: none; }
.hive-detail .hive-item { min-block-size: 0; padding-block: 6px; }
.hive-detail .hive-item__main { flex-direction: column; flex-wrap: nowrap; align-items: start; gap: 0; block-size: auto; overflow: visible; }
.hive-detail .hive-item__kind { white-space: normal; }

/* ── A list of facts ──────────────────────────────────────────────────────────────────────────────────────────── */

/* One label column for every list in a detail, so their values stand on one edge: 88 px, which holds one or two
   short words. A detail whose longest label is longer sets `--facts-label` once on itself, to that label's width;
   no list sets a column of its own, and a label that wraps is a fault of the words or of that one setting.
   Facts stand 28 px apart; the lines of one value that wraps stand 20 px apart, so a value of three lines reads as
   one fact and the next fact as the next (at one pitch for both they read as one block). */
.hive-facts {
  display: grid;
  grid-template-columns: var(--facts-label, 88px) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 12px;
  margin: 0;
  font: var(--text-meta);
}
/* A tag or a count's pill inside a value stands on the value's baseline, as a word does, and adds nothing to the value's
   20 px line: its 12 px words sit lower in its 20 px box than the value's 14 px words in theirs, so without the 2 px
   given back above and below it would stand under the line's foot and part this fact from the next by 1 px more. A
   person's chip is not a word: it is centred on the line, its margin box the line's own height, hung from the
   line's top. */
.hive-facts dd > :is(.hive-pill, .hive-tag) { margin-block: -2px; vertical-align: baseline; }
.hive-facts > div { display: contents; }
.hive-facts dt { color: var(--ink-2); }
.hive-facts dd {
  margin: 0;
  min-inline-size: 0;
  color: var(--ink-1);
  overflow-wrap: anywhere;
}
.hive-facts dd > small { font: inherit; color: var(--ink-2); white-space: nowrap; }
.hive-facts dd > q { display: block; quotes: none; color: var(--ink-2); line-height: 20px; padding-block-end: 4px; text-wrap: pretty; }
.hive-facts .hive-person { vertical-align: top; margin-block: -1px; margin-inline-end: 6px; }

/* A person's chip beside a line of this system's text is 22 px on every card, row and detail, its initials a label's
   size. Only a chip that says its own larger size (36, 48) is another. */
:is(.hive-bar, .hive-page, .hive-card, .hive-detail, .hive-menu) .hive-person:not([data-size='36'], [data-size='48']) {
  --hive-person-size: 22px;
  font: var(--text-head-label);
  letter-spacing: 0;
}

/* What Hive saw, as a whole line: the literal face on the detail's ground, never a tag (words.md). */
.hive-literal {
  margin: 0;
  font: var(--text-literal);
  line-height: 18px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.hive-literal > time { color: var(--ink-2); margin-inline-end: 12px; }

/* ── A link: words that go somewhere, inside a line ───────────────────────────────────────────────────────────── */
/* A link goes somewhere (another page, or a place on this one); a button does something (states, sends, chooses, opens
   a menu). A link is words of the line it stands in: the line's own size and line, on its baseline (never a button's
   box), in the first ink, with an underline in the second ink at rest that takes the first ink when pointed at, and the
   ring every control takes when focused. On a phone its target is 44 px by padding above and below, which an inline
   box adds without moving the line. */
.hive-link {
  font: inherit;
  color: var(--ink-1);
  text-decoration: underline;
  text-decoration-color: var(--ink-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  border-radius: 2px;
  cursor: pointer;
  transition: text-decoration-color 100ms ease-out;
}
.hive-link:hover { text-decoration-color: var(--ink-1); }
.hive-link:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }
button.hive-link { padding: 0; border: 0; background: none; text-align: inherit; }
@media (max-width: 759.98px) {
  .hive-link,
  button.hive-link { padding-block: 12px; }
}

/* ── A tag ────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* A level, a kind, a scope: 20 px, the pill's own height, one quiet face and one shape. A literal is the same tag
   in the literal face, for a short path inside a line of reading. */

.hive-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-inline-size: 100%;
  block-size: 20px;
  box-sizing: border-box;
  padding: 0 6px;
  border-radius: var(--corner-tag);
  background: var(--face-quiet);
  font: var(--text-label);
  line-height: 20px;
  letter-spacing: var(--track-12);
  color: var(--ink-2);
  white-space: nowrap;
}
.hive-tag--literal { font: var(--text-literal); line-height: 20px; letter-spacing: 0; }
.hive-tag > svg { flex: none; align-self: center; color: var(--ink-quiet); }
/* A path as a tag: it may take a second line, after a slash (its page puts the break opportunities there), and each
   line keeps the tag's face and its 20 px. */
.hive-tag--path {
  display: inline;
  block-size: auto;
  padding-block: 1px;
  font: var(--text-literal);
  /* The line it stands in keeps its own height: a path in a fact's value does not make the fact taller. */
  line-height: inherit;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ── A button: four forms, three sizes ────────────────────────────────────────────────────────────────────────── */
/* The cream fill for the one primary action of a page; edged for an action; quiet for an action that is asked for;
   and one that takes something away, quiet until it is armed. Every one has a face or an edge at rest. */

/* A button is a grid of one row so its label gives it its baseline (a line that aligns words aligns a button by its
   label, never by its box) while the label stays centred in the face; its mark centres itself on that row. */
.hive-button {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: baseline;
  align-content: center;
  justify-content: center;
  gap: 6px;
  block-size: 32px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--corner-control);
  background: var(--face-quiet);
  font: var(--text-control);
  color: var(--ink-1);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 100ms ease-out, border-color 100ms ease-out, color 100ms ease-out;
}
.hive-button:hover { background: var(--face-quiet-hover); }
.hive-button:active { background: var(--face-quiet-press); }
/* A control whose own lines stand open under it keeps its pressed face while they do. */
.hive-button[aria-expanded='true'] { background: var(--face-quiet-press); }
.hive-button:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }
.hive-button > :is(svg, .hive-icon) { align-self: center; }
.hive-button > svg { flex: none; color: var(--ink-2); }

.hive-button--small { block-size: 28px; padding-inline: 10px; border-radius: 7px; }
.hive-button--large { block-size: 40px; padding-inline: 16px; font: var(--text-name); }
/* A button that is a mark alone has no words to stand on a line: it centres itself on it. */
.hive-button--icon { inline-size: 32px; padding: 0; align-self: center; }
.hive-button--icon.hive-button--small { inline-size: 28px; }

.hive-button--primary {
  background: var(--face-primary);
  color: var(--ink-on-primary);
  font-weight: 600;
}
.hive-button--primary:hover { background: var(--face-primary-hover); }
.hive-button--primary:active { background: var(--face-primary-press); }
.hive-button--primary > svg { color: inherit; }

.hive-button--edged {
  border-color: var(--line-control);
  background: transparent;
}
.hive-button--edged:hover { background: var(--face-quiet); border-color: rgb(255 255 255 / 0.26); }
.hive-button--edged:active { background: var(--face-quiet-hover); }

/* What takes something away is the quiet button at rest, so it never reads as the dead half of a pair; armed, it
   is edged and on a raised face. Never blue, never red. */
.hive-button--danger[data-armed] {
  border-color: var(--ink-2);
  background: var(--surface-3);
}

/* Disabled, in every form: no plate, a faint edge, and a label in the tone of what is not read. */
.hive-button:disabled,
.hive-button[aria-disabled='true'] {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-quiet);
  cursor: default;
}
.hive-button:disabled > svg { color: inherit; }
/* The primary not yet open to a press (nothing written yet) stays the page's one action: a faint tint of its cream
   and its label in the second ink, still read at 4.5:1. While what it sends is on its way (its form busy) it keeps
   its cream at a lower strength and its label whole, so the press is seen to have been taken. */
.hive-button--primary:disabled,
.hive-button--primary[aria-disabled='true'] {
  border-color: transparent;
  background: color-mix(in srgb, var(--face-primary) 12%, transparent);
  color: var(--ink-2);
}
[aria-busy='true'] .hive-button--primary:disabled {
  background: color-mix(in srgb, var(--face-primary) 55%, var(--surface-1));
  color: var(--ink-on-primary);
  cursor: progress;
}

@media (max-width: 759.98px) {
  .hive-button,
  .hive-button--small,
  .hive-button--large { block-size: 44px; padding-inline: 16px; font: var(--text-name); border-radius: var(--corner-control); }
  .hive-button--icon { inline-size: 44px; padding: 0; }
}

/* ── A segmented control: one choice of a few ─────────────────────────────────────────────────────────────────── */

.hive-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--corner-control);
  background: var(--surface-0);
}
.hive-segmented__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  block-size: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: var(--text-control);
  font-weight: 400;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 100ms ease-out, color 100ms ease-out;
}
.hive-segmented__option:not([aria-pressed='true'], [aria-checked='true'], :has(> input:checked)):hover { color: var(--ink-1); }
/* The chosen option is a raised face clearly lighter than the track, its words in the first ink at 500. Never the
   cream fill: that is the page's one action alone (`--face-primary`), and three cream fills on one line read as three
   choices with no action among them. */
.hive-segmented__option[aria-pressed='true'],
.hive-segmented__option[aria-checked='true'],
.hive-segmented__option:has(> input:checked) { background: var(--face-segment-chosen); color: var(--ink-1); font-weight: 500; }
.hive-segmented__option:focus-visible,
.hive-segmented__option:has(> input:focus-visible) { outline: 2px solid var(--ink-1); outline-offset: 2px; }
/* The same control as a form's radios: a fieldset of labels, each holding its input, the chosen one raised. */
fieldset.hive-segmented { margin: 0; min-inline-size: 0; }
.hive-segmented__option { position: relative; white-space: nowrap; }
.hive-segmented__option > input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
fieldset.hive-segmented:disabled .hive-segmented__option { color: var(--ink-quiet); cursor: default; }

/* ── A field ──────────────────────────────────────────────────────────────────────────────────────────────────── */

.hive-field {
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line-control);
  border-radius: var(--corner-control);
  background: var(--surface-0);
  font: var(--text-body);
  color: var(--ink-1);
}
.hive-field::placeholder { color: var(--ink-2); }
.hive-field:hover { border-color: rgb(255 255 255 / 0.26); }
.hive-field:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 1px; }
.hive-field--literal { font: var(--text-literal); line-height: 20px; }
/* A field that is its card: where a page's first card is the way to say something (Decisions' composer), the card is
   the field's edge and face. The field draws none of its own, so the composer is one surface and not a box in a box,
   and the card's edge answers when the field is focused, as a field's own edge would. */
.hive-field--bare { padding: 0; border-color: transparent; background: transparent; resize: none; }
/* Its example is quieter than any real words on the page, so it reads as what to type and not as something already
   said, and still clears 4.5:1 on the card. */
.hive-field--bare::placeholder { color: color-mix(in srgb, var(--ink-2) 78%, var(--surface-1)); }
.hive-field--bare:hover { border-color: transparent; }
.hive-field--bare:focus-visible { outline: none; }
.hive-card:has(.hive-field--bare:focus-visible) { border-color: var(--ink-2); }
/* Words being written are typed, and their example shown, at the size they will have where they are listed: a
   statement is what its row is about, so the name's 16 px, in the reading weight. Larger, the example outranked every
   row's name on the page. */
.hive-field--statement { min-block-size: 72px; padding: 10px 12px; font: var(--text-name); font-weight: 400; letter-spacing: var(--track-16); resize: vertical; }
/* A statement's field that is its card: its words stand on the card's own inset, and it has no grip of its own. */
.hive-field--statement.hive-field--bare { padding: 0; resize: none; }

/* ── The floor ────────────────────────────────────────────────────────────────────────────────────────────────── */
/* The smallest text of this system is its 12 px labels, tags and literals, and the product's floor is 12 too
   (web/system/type.css `--type-size-floor`). Every part of the system still says so in the product's own token, so a
   surface that sets a floor of its own around it (a Map card) cannot raise a label here, and whatever asks what the
   floor is where a word stands (the type roles, the typography test) reads 12 on a surface of this system. */
:is(.hive-top, .hive-page, .hive-card, .hive-section, .hive-section__head, .hive-list, .hive-item, .hive-detail, .hive-facts,
  .hive-filter, .hive-menu, .hive-notice, .hive-tag, .hive-pill, .hive-button, .hive-segmented, .hive-literal, .hive-meta,
  .hive-field, .hive-form) {
  --type-size-floor: 12px;
}

/* ── A menu ───────────────────────────────────────────────────────────────────────────────────────────────────── */
/* A short list of actions that opens from its control and floats over the page (web/system/menu.js `openMenu`):
   the one surface that does, so a shadow lifts it off what it opens over. As wide as its longest item, 180 px at
   least. It fades in from its control's side and out again. */

.hive-menu {
  display: grid;
  min-inline-size: 180px;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid var(--line-control);
  border-radius: var(--corner-card);
  background: var(--surface-2);
}
.hive-menu[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  max-block-size: min(60dvh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
  color: var(--ink-1);
  transform-origin: top center;
  transition: opacity 150ms ease-out, transform 150ms ease-out, overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.hive-menu[popover][data-place='above'] { transform-origin: bottom center; }
@starting-style {
  .hive-menu[popover]:popover-open { opacity: 0; transform: scale(0.97); }
}
/* Closed is not drawn: this part sets its own `display`, which would otherwise stand over a closed popover's. */
.hive-menu[popover]:not(:popover-open) {
  display: none;
  opacity: 0;
  transform: scale(0.97);
  transition-duration: 100ms;
  transition-timing-function: ease-in;
}
.hive-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  block-size: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: var(--text-control);
  color: var(--ink-1);
  text-align: start;
  white-space: nowrap;
  cursor: pointer;
}
.hive-menu__item:hover,
.hive-menu__item:focus { outline: none; background: var(--face-quiet-hover); }
.hive-menu__item:focus-visible { outline: 2px solid var(--ink-1); outline-offset: -2px; }
.hive-menu__item:active { background: var(--face-quiet-press); }
.hive-menu__item > :is(svg, .hive-icon) { flex: none; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) {
  .hive-menu[popover],
  .hive-menu[popover]:not(:popover-open) { transform: none; }
  @starting-style {
    .hive-menu[popover]:popover-open { transform: none; }
  }
}

/* ── A phone ──────────────────────────────────────────────────────────────────────────────────────────────────── */
/* One column inside the gutter and no bordered card (phone.md law 1): a card is a group, its rows the window's
   width, each one target of at least 56 px. The bar keeps the wordmark, the swarm and coverage; the destinations
   stand in the bottom bar. */

.hive-tabbar { display: none; }

@media (max-width: 759.98px) {
  .hive-bar__tabs,
  .hive-bar__account { display: none; }

  .hive-page { padding-block-end: 80px; }
  .hive-page__head { min-block-size: 52px; padding-block: 8px; }

  .hive-split { grid-template-columns: minmax(0, 1fr); }

  .hive-card {
    margin-inline: calc(-1 * var(--page-gutter));
    border: 0;
    border-radius: 0;
    background: none;
  }
  .hive-section__head { padding-inline: var(--page-gutter); }
  .hive-item { min-block-size: 56px; padding-inline: var(--page-gutter); }

  /* A detail is a screen: its parts on the page's ground, its acts the window's width. */
  .hive-detail {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .hive-detail .hive-list,
  .hive-detail__rule,
  .hive-detail__foot { margin-inline: calc(-1 * var(--page-gutter)); }
  .hive-detail__foot { margin-block-end: 0; padding-inline: var(--page-gutter); }

  .hive-tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    block-size: 56px;
    background: var(--surface-0);
    box-shadow: inset 0 1px 0 var(--line);
  }
  .hive-tabbar__cell {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    font: var(--text-label);
    color: var(--ink-2);
    text-decoration: none;
  }
  .hive-tabbar__cell[aria-current='page'] { color: var(--ink-1); font-weight: 600; }
  .hive-tabbar__cell[aria-current='page']::after {
    content: '';
    position: absolute;
    inset: 0 20% auto;
    block-size: 2px;
    background: var(--ink-you);
  }
  .hive-tabbar__cell > .hive-pill { position: absolute; inset: 6px auto auto calc(50% + 4px); }
}

/* ── A switch and a check: a fact that saves when it is changed ───────────────────────────────────────────────── */

.hive-switch {
  position: relative;
  flex: none;
  inline-size: 28px;
  block-size: 16px;
  margin: 0;
  border: 0;
  border-radius: 100px;
  background: var(--line-control);
  appearance: none;
  cursor: pointer;
  transition: background-color 100ms ease-out;
}
.hive-switch::after {
  content: '';
  position: absolute;
  inset: 2px auto 2px 2px;
  inline-size: 12px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: translate 100ms ease-out, background-color 100ms ease-out;
}
.hive-switch:checked { background: var(--ink-you); }
.hive-switch:checked::after { translate: 12px 0; background: var(--ink-on-filled); }
.hive-switch:focus-visible,
.hive-check:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }

.hive-check {
  flex: none;
  inline-size: 16px;
  block-size: 16px;
  margin: 0;
  border: 1px solid var(--line-control);
  border-radius: 4px;
  background: var(--surface-0);
  appearance: none;
  cursor: pointer;
}
.hive-check:checked {
  border-color: var(--ink-you);
  background: var(--ink-you) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.6' fill='none' stroke='%23141414' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* A line that holds a control and the words it switches: the words lead, the control ends the line. */
.hive-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 32px;
  padding: 4px 16px;
  font: var(--text-meta);
  color: var(--ink-2);
}
.hive-option > :first-child { flex: 1 1 auto; min-inline-size: 0; color: var(--ink-1); }
.hive-option > small { font: inherit; color: var(--ink-2); }

/* ── A state that stands for a list: nothing here, or it could not be read ────────────────────────────────────── */

.hive-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 8px 12px;
  min-block-size: 40px;
  padding: 10px 16px;
  font: var(--text-meta);
  color: var(--ink-2);
}

/* ── A state: what is true where a page or a list would stand (web/system/state-sheet.js) ─────────────────────── */
/* One line at the title's size, at most one line of meta under it, at most one action, which is this system's
   button at every width. On a desk the sheet is the system's card. A state that only says nothing is here yet
   (`data-state="empty"`) is set as the system sets every word that stands in for a missing one: the reading weight in
   the quiet ink. A page that shows a state inside a card of its own drops the outer card in its own stylesheet. */
@media (min-width: 760px) {
  .hive-sheet.state-sheet {
    padding: 24px;
    border-color: var(--line);
    border-radius: var(--corner-card);
    background: var(--surface-1);
  }
  .state-sheet .state-sheet__status { min-block-size: 28px; }
  .state-sheet .state-sheet__title {
    font: var(--text-title);
    letter-spacing: var(--track-20);
    color: var(--ink-1);
  }
  .state-sheet[data-state='empty'] .state-sheet__title { font-weight: 400; color: var(--ink-2); }
  .state-sheet .state-sheet__context {
    margin-block-start: 4px;
    font: var(--text-meta);
    color: var(--ink-2);
  }
  .state-sheet .state-sheet__action { margin-block-start: 16px; }
}

/* ── The Record ───────────────────────────────────────────────────────────────────────────────────────────────── */
/* The Record keeps its own grid and its own marks (web/record/): the goal, its time and Now on one scale down the
   page. It has no parts here. Every size of its text comes from a type role and every ink from a token, so on a desk
   it sets those roles and tokens to this system's values, once (web/record/record.css, its last block), and uses the
   system's controls: the pill, the icon button, the choice of a few, the tag, the primary button. */

/* ── A dated list: what happened and when ─────────────────────────────────────────────────────────────────────── */
/* Each line's clock first, in one column as wide as the widest clock, then its words on the clock's baseline; no
   nodes and no rail. A line with no clock (`:only-child`, or `__words` alone) keeps its words in the words' column.
   The clock is in the second ink with tabular figures; the lines stand 24 px apart. */
.hive-dated {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font: var(--text-meta);
  color: var(--ink-1);
}
.hive-dated > li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  min-inline-size: 0;
}
.hive-dated time,
.hive-dated__when { color: var(--ink-2); font-feature-settings: 'lnum' 1, 'tnum' 1; white-space: nowrap; }
.hive-dated > li > :only-child,
.hive-dated__words { grid-column: 2; min-inline-size: 0; overflow-wrap: anywhere; }

/* ── Words stand on the line; what is not a word centres itself on it ─────────────────────────────────────────── */
/* Every line of this system that holds words of more than one size aligns them on their baselines (`align-items:
   baseline` in the part: a row, a head, a card's first line, a fact, a line of meta, a page's first line). A mark, a
   person's chip, a switch or a check has no baseline of its own, so it is centred on the line it stands in. The
   tempting wrong edit is `align-items: center` on a line of words: a name then rides 1 to 3 px off its meta
   (tests/web/page-system-lines.test.js fails on any page that does it). */
:is(.hive-page__head, .hive-page__tools, .hive-card__top, .hive-card__top-end, .hive-card__head, .hive-card__head-end, .hive-section__head,
  .hive-section__name, .hive-section__end, .hive-detail__top, .hive-detail__state, .hive-detail__by, .hive-item__main, .hive-item__where,
  .hive-item__under, .hive-meta, .hive-notice)
  > :is(svg, .hive-icon, .hive-glyph, .hive-person, .hive-switch, .hive-check) { align-self: center; }
/* A chip inside a run of words (a fact's value, an item of a meta line, a head's name) is centred on its line and
   adds nothing to the line's height: its margin box is the line's own height (20 px for meta, 16 for a head), hung
   from the line's top. */
:is(.hive-facts dd, .hive-meta > *, .hive-detail__state) > .hive-person { vertical-align: top; margin-block: -1px; }
.hive-section__name > .hive-person { vertical-align: top; margin-block: -3px; }

/* ── A word with a type role of its own takes its line's height ───────────────────────────────────────────────── */
/* An age is a `time`, and a `time` (like any word given a type role) sets its own line as a ratio (20 / 14). That
   can land a fraction of a pixel over the 20 px it means, and the line it stands in becomes 21 px: a fact that held an
   age stood 29 px from the next (the pitch is 28). Inside this system's lines of running words such a word takes the
   line's own height. A pill or a tag keeps its own 20 px line, whatever element it is. */
:is(.hive-facts, .hive-meta, .hive-section__head, .hive-card__top, .hive-card__head, .hive-detail__state, .hive-detail__by, .hive-notice,
  .hive-dated) :is(time, [data-type]):not(.hive-tag, .hive-pill, .hive-button, .hive-person) { line-height: inherit; }

/* ── One shape for every figure ───────────────────────────────────────────────────────────────────────────────── */
/* Tabular lining figures everywhere outside the Map's stage: a column of ages aligns, and the figure 1 has one shape
   whether it stands in a count, an age or a sentence (set in some places only, both shapes met in one line). It is
   `!important` because every part sets its type with the `font` shorthand, which sets this back to normal. */
.gc-root :not(.area-map, .area-map *),
.area-map :is(.hive-detail, .hive-card, .hive-menu),
.area-map :is(.hive-detail, .hive-card, .hive-menu) * { font-variant-numeric: lining-nums tabular-nums !important; }

/* ── A form: a label over its control ─────────────────────────────────────────────────────────────────────────── */
/* In a 400 px column a label beside its control leaves a path 240 px; over it, the control has the whole measure. */

.hive-form { display: grid; gap: 12px; }
.hive-form__row { display: grid; gap: 6px; justify-items: start; }
.hive-form__row > :is(.hive-field, textarea, input) { justify-self: stretch; }
.hive-form__label {
  font: var(--text-label);
  letter-spacing: var(--track-12);
  color: var(--ink-2);
}
.hive-form__note { font: var(--text-meta); color: var(--ink-2); }

/* ── A phone's screen ─────────────────────────────────────────────────────────────────────────────────────────── */
/* The screen, its Back and its one foot belong to web/system/screen.css. A detail on a screen gives its primary
   action to that foot and keeps its other acts in its body. */

@media (max-width: 759.98px) {
  /* On a screen the detail's own foot holds its other acts, in the body; its primary is the screen's foot. */
  .hive-detail__foot > .hive-button--primary { display: none; }

}
