/* The console's own layout, on top of substrait-ui. Role tokens only: no
   literal colours, so brand and mode stay the kit's decision. */

.shell {
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
  color: var(--text-body);
}

/* Skip link (layout.templ): hidden until Tab reaches it, then drawn over
   the header's top corner. The page it leads to takes focus without a ring. */
.skip-link:focus {
  position: fixed;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-card);
  color: var(--text-link);
  border: 1px solid var(--border-strong);
}
.shell-main:focus { outline: none; }

/* The two header rows (views.Layout), as the design draws them (app.jsx
   AppShell): the identity row, 52px, and the tab row, 42px, on the card
   surface under one hairline, held at the top of the viewport. No sidebar:
   five sections do not earn a permanent column. */
.shell-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  background: var(--surface-card);
  border-block-end: 1px solid var(--border-structure);
}

.shell-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  block-size: 52px;
  padding-inline: var(--space-5);
  min-inline-size: 0;
}

/* The wordmark: the mark at 1.35 times the type, 17px, set tight. */
.shell-identity .lockup {
  --cluster-gap: 9px;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text-body);
  text-decoration: none;
  flex: none;
}

.shell-identity .lockup .logo {
  inline-size: 23px;
  block-size: 23px;
}

.shell-rule {
  inline-size: 1px;
  block-size: 20px;
  background: var(--border-interior);
  flex: none;
}

.shell-slash {
  color: var(--text-label);
}

.shell-grow {
  flex: 1;
}

.shell-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-body);
  font: 500 var(--fs-13) / 1 var(--font-body);
  cursor: pointer;
  min-inline-size: 0;
  white-space: nowrap;
}

.shell-org {
  gap: 7px;
  font-weight: 400;
  color: var(--text-secondary);
}

.shell-trigger > span:not(.avatar) {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The design's avatars: a square of the name's first letter, mono. */
.shell-avatar {
  inline-size: 24px;
  block-size: 24px;
  font-size: var(--fs-11);
}

.shell-avatar[data-size="sm"] {
  inline-size: 20px;
  block-size: 20px;
  font-size: var(--fs-10);
}

.shell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
}

/* Search: a field-shaped button, 200px, that opens the palette. */
.shell-search {
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: 200px;
  block-size: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border-structure);
  background: var(--surface-well);
  color: var(--text-secondary);
  box-shadow: var(--elevation-inset-top);
  font: 400 var(--fs-13) / 1 var(--font-body);
  cursor: pointer;
}

.shell-search kbd {
  font: 500 var(--fs-10) / 1 var(--font-mono);
  color: var(--text-secondary);
  background: var(--surface-card);
  border: 1px solid var(--border-structure);
  padding: 2px 5px;
}

/* Settings' trigger: a quiet icon button, as the design's IconBtn. */
.shell-icon-btn {
  display: grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.shell-icon-btn:hover {
  background: var(--surface-well);
}

/* The shell's menus and inbox are the kit's; the shell sets their widths,
   and those on the right open leftward, under their trigger. */
.shell-menu {
  --pop-min-inline: 230px;
  --pop-max-inline: 260px;
}

.shell-inbox {
  --pop-pad: 0;
  --pop-min-inline: 400px;
  --pop-max-inline: 400px;
  max-block-size: 480px;
}

#inbox,
#settings-menu,
#account-menu {
  position-area: block-end span-inline-start;
}

/* The theme: two segments, the one in effect underlined. */
.shell-theme {
  display: inline-grid;
  grid-template-columns: auto auto;
  border: 1px solid var(--border-structure);
  background: var(--surface-card);
  box-shadow: var(--elevation-contact);
}

.shell-theme button {
  display: grid;
  place-items: center;
  block-size: 26px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.shell-theme button + button {
  border-inline-start: 1px solid var(--border-structure);
}

.shell-theme button[aria-pressed="true"] {
  background: var(--surface-well);
  box-shadow: inset 0 -2px 0 var(--action-primary);
  color: var(--text-body);
}

/* The tab row: the five sections, the current one underlined. */
.shell-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  block-size: 42px;
  padding-inline: var(--space-5);
  overflow-x: auto;
  scrollbar-width: none;
}

.shell-tabs > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font: 500 var(--fs-13) / 1 var(--font-body);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.shell-tabs > a:hover {
  color: var(--text-body);
}

.shell-tabs > a[aria-current="page"] {
  color: var(--text-body);
  box-shadow: inset 0 -2px 0 var(--action-primary);
}

.shell-tabs .count {
  font: 500 var(--fs-10) / 1 var(--font-mono);
  padding: 2px 5px;
}

/* The avatar menu's organization, Settings, search and theme: a phone's
   only way to them, so shown only there (below). */
.shell-phone-only {
  display: none;
}

.shell-theme-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 40rem) {
  .shell-identity {
    gap: 8px;
    padding-inline: var(--space-4);
  }

  .shell-tabs {
    padding-inline: var(--space-3);
  }

  /* On a phone the header is one compact row, pinned to the top under the
     notch: the mark, the workspace, the bell and the menu button. Search,
     the organization, Settings, the theme and the viewer's account are in
     the menu's sheet (views.phoneMenu); the sections are on the bottom
     tab bar. */
  .shell-header {
    padding-block-start: env(safe-area-inset-top);
  }

  .shell-actions > .shell-search,
  .shell-org,
  .shell-slash,
  .shell-rule,
  #settings-open,
  .shell-actions > .shell-theme,
  #account-open {
    display: none;
  }

  .shell-actions > .shell-menu-btn {
    display: grid;
    inline-size: 36px;
    block-size: 36px;
    color: var(--text-body);
  }

  /* The menu's sheet drops from under the header, the screen's width. */
  .shell-sheet:popover-open {
    display: block;
  }

  .shell-sheet {
    --pop-min-inline: 100%;
    --pop-max-inline: 100%;
    --pop-pad: var(--space-2);
    position-area: none;
    inset: calc(52px + env(safe-area-inset-top)) 0 auto 0;
    inline-size: 100%;
    max-block-size: calc(100dvh - 52px - 56px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: 0;
    border-inline: 0;
    padding-inline: calc(var(--space-2) + env(safe-area-inset-left)) calc(var(--space-2) + env(safe-area-inset-right));
  }

  .shell-sheet .shell-sheet-search {
    inline-size: 100%;
    block-size: 40px;
    margin-block-end: var(--space-2);
  }

  .shell-sheet-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline-end: var(--pop-item-pad);
  }

  .shell-sheet-theme .shell-theme button {
    block-size: 32px;
    padding: 0 14px;
  }

  /* ...and the avatar's menu holds them instead. */
  .shell-phone-only {
    display: block;
  }

  .shell-identity .lockup > span {
    display: none;
  }

  .shell-inbox {
    --pop-min-inline: calc(100vw - 2 * var(--space-4));
    --pop-max-inline: calc(100vw - 2 * var(--space-4));
  }
}

/* The phone's menu button and its sheet show only on a phone (above). */
.shell-menu-btn,
.shell-sheet {
  display: none;
}

/* The design's ground: 48px of it around every page. */
.shell-main {
  flex: 1;
  padding: var(--space-7);
}

@media (max-width: 40rem) {
  .shell-main {
    padding: var(--space-4);
  }
}

/* Each page is centred on the ground. A page that sets its own measure
   (the queue's 1200px, a form's 880px, the board's scroll area) says so
   with data-measure, and the shell leaves its width to it. */
.shell-page {
  inline-size: 100%;
  max-inline-size: var(--w-page-max);
  margin-inline: auto;
}

.shell-page:has(> [data-measure]) {
  max-inline-size: none;
}

/* A tab's views, or a Settings group's pages, sit above the page. */
.shell-main > nav {
  max-inline-size: var(--w-page-max);
  margin-inline: auto;
  /* A long row (Settings' Platform group) scrolls inside itself, so it
     never widens a phone's page. */
  overflow-x: auto;
  scrollbar-width: none;
}

.shell-main > nav + .shell-page {
  margin-block-start: var(--space-5);
}

/* On a phone the row of views is held to the screen's width and swipes
   sideways, a whole view at a time; the segmented kit's fit-content row
   scrolls inside it and never widens the page, which is what let the
   pinned header drift over a page like Settings › Organization. */
@media (max-width: 40rem) {
  .shell-main > nav {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
  }

  .shell-main > nav > .tabs {
    max-inline-size: none;
    min-inline-size: 0;
  }

  .shell-main > nav > .tabs > a {
    scroll-snap-align: start;
  }
}

.shell-login {
  flex: 1;
  display: grid;
  place-items: start center;
  padding-block-start: var(--space-9);
}

/* The sign-in card is the kit's card; this only sizes it. */
.shell-login-card {
  inline-size: min(28rem, 100% - 2 * var(--space-5));
}

/* A sent note's pin opens its work item's card in the Annotate frame
   (views.AnnotateFrame): title and close on one line, the question it
   waits on set off. */
.annotate-card-head {
  justify-content: space-between;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.annotate-card blockquote {
  margin: 0;
  padding-inline-start: var(--space-3);
  border-inline-start: 2px solid var(--border-structure);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* A one-time link's page names who it signs in: a long address wraps.
   Why a link cannot be used sits in the card, so its banner keeps the
   card's own inset rather than the page's. */
.access-link-email {
  overflow-wrap: anywhere;
}

.access-link .banner {
  --banner-pad-inline: var(--space-3);
}

/* The command palette's dialog (views.Palette): a fixed measure near the top
   of the viewport, where a palette sits, instead of the dialog block's
   centred max-content, which would shrink to the longest label. */
.shell-palette {
  inline-size: min(760px, 100% - 2 * var(--space-5));
  margin-block: 12dvb auto;
}

.shell-palette .palette-list {
  margin-block-start: var(--space-2);
  max-block-size: 50dvb;
  overflow-y: auto;
}

/* Rows run their command on click (app/shell.js). The kit draws no :hover
   fill on purpose: pointer movement sets the active row instead. */
.shell-palette .palette-option {
  cursor: pointer;
}




.shell-palette .empty {
  margin-block-start: var(--space-2);
}

/* The amber count on the Decisions tab (views.WaitingCount): the wrapper
   is there for the stream to swap and takes no box of its own, so the
   count is the link's own flex item. */
.shell-count {
  display: contents;
}


/* An id, a path or a branch keeps its case inside a mono label or a chip,
   which the kit upper-cases: upper-cased it is a different name to read. */
:is(.lbl, .chip) .u-mono,
.chip.u-mono {
  text-transform: none;
  letter-spacing: 0;
}

/* A page's explanatory sentence: body type in the secondary ink, at the
   kit's reading measure (u-measure). */
.page-note {
  margin: 0;
  color: var(--text-secondary);
}

/* Settings (views.SettingsPage, S-01): one list at the page's measure,
   each row an icon, the setting, what it holds, its state and a way in. */
.settings {
  display: grid;
  gap: var(--space-6);
  inline-size: 100%;
  max-inline-size: 940px;
  margin-inline: auto;
}

.settings-group {
  --stack-gap: var(--space-4);
}

/* Platform, folded under "For operators": closed until opened. */
.settings-fold > summary {
  cursor: pointer;
  margin-block-end: var(--space-4);
}

/* Under a group's heading: who the group is for (Platform). */
.settings-head-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-13);
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-structure);
}

.settings-list > li + li {
  border-block-start: 1px solid var(--border-interior);
}

.settings-row {
  display: grid;
  grid-template-columns: 18px minmax(10rem, 13rem) minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: var(--space-4);
  min-block-size: 54px;
  padding: 0 var(--space-4) 0 var(--space-5);
  color: var(--text-body);
  text-decoration: none;
}

a.settings-row:hover {
  background: var(--surface-well);
}

.settings-glyph,
.settings-row > [data-glyph="chevron-right"] {
  color: var(--text-secondary);
}

.settings-name {
  font-size: var(--fs-14);
  font-weight: 500;
}

.settings-row[aria-disabled] .settings-name {
  color: var(--text-secondary);
}

.settings-note {
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

.settings-status .chip {
  font: 500 var(--fs-10) / 1 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

@media (max-width: 40rem) {
  .settings-row {
    grid-template-columns: 18px minmax(0, 1fr) auto 16px;
    padding-block: var(--space-3);
  }

  .settings-note {
    grid-column: 2 / -1;
    grid-row: 2;
  }
}

/* Settings' pages (Repositories, Identities, Audit, Rules and gates): a
   cell or a heading that leads with a name a person reads and puts its
   id, branch or commit under it, small, keeping its case. */
.settings-stack {
  display: grid;
  gap: 2px;
}

.settings-sub {
  font-size: var(--fs-11);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* A scroller that scrolls only sideways keeps no gutter for a vertical
   scrollbar it never shows, so a table in one meets its card's edges. */
.scroller.scroller-inline {
  scrollbar-gutter: auto;
}

/* People and roles (views.PeoplePage, O-09): the people table at the
   design's 1000px sheet, then two notes side by side. */
.people {
  display: grid;
  gap: var(--space-5);
  inline-size: 100%;
  max-inline-size: 1000px;
  margin-inline: auto;
}

.people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.people-head > .lbl {
  margin: 0;
}

.people-table {
  inline-size: 100%;
}

.people-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 500;
}

.people-name {
  display: grid;
}
/* A wide table squeezed the Person column until "Person 1" broke a letter
   at a time; on a screen wide enough for the table, a name keeps a line. */
@media (min-width: 40rem) {
  .people-members-table .people-name { white-space: nowrap; }
}

.people-id {
  font-size: var(--fs-11);
  font-weight: 400;
  color: var(--text-secondary);
}

.people-none {
  color: var(--text-label);
}

/* What each role can do (views.rolesHelp): a link beside a role choice
   opens a small card in the middle of the screen. */
.people-roles-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-13);
  color: var(--text-link);
  text-decoration: underline;
  cursor: pointer;
  justify-self: start;
}

.people-roles-help {
  position: fixed;
  inset: 0;
  margin: auto;
  inline-size: min(420px, calc(100vw - 2 * var(--space-4)));
  block-size: fit-content;
  padding: 0;
  border: 1px solid var(--border-structure);
  box-shadow: var(--elevation-pop, var(--elevation-card));
}

/* The card sets display; keep the closed popover shut. */
.people-roles-help:not(:popover-open) {
  display: none;
}

.people-roles-help .card-head > .btn {
  margin-inline-start: auto;
}

.people-roles-table {
  border-collapse: collapse;
  inline-size: 100%;
}

.people-roles-table th,
.people-roles-table td {
  padding: var(--space-2) 0;
  text-align: start;
  vertical-align: top;
}

.people-roles-table th {
  padding-inline-end: var(--space-3);
  white-space: nowrap;
}

.people-roles-note {
  margin: var(--space-3) 0 0;
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

/* Across workspaces (views.OrgPage, ORG-01): four figures, what waits on a
   person anywhere, then a card a workspace, on the design's 1080px sheet. */
.org {
  display: grid;
  gap: var(--space-6);
  inline-size: 100%;
  max-inline-size: 1080px;
  margin-inline: auto;
}

.org-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.org-head > .lbl,
.org-section > .lbl {
  margin: 0;
}

/* Four figures in a row, two by two on a phone, as the design's. */
.org-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--space-5);
}

/* A figure is a stack, as Usage's: its label, the figure, a note. */
.org-metrics .metric {
  display: grid;
  gap: 6px;
  align-content: start;
}

.org-metrics .metric-label,
.org-facts .metric-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.org-value {
  font-family: var(--font-mono);
  font-size: var(--fs-26);
  font-variant-numeric: tabular-nums;
}

.org-unit {
  margin-inline-start: var(--space-2);
  font-size: var(--fs-11);
  color: var(--text-secondary);
}

.org-unmeasured {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-secondary);
}

.org-unmeasured-sm {
  color: var(--text-secondary);
}

.org-section {
  display: grid;
  gap: var(--space-4);
}

.org-waiting {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-human);
  box-shadow: var(--elevation-card);
}

/* A waiting decision leads with its question; where it blocks work, who
   it waits on and for how long follow, its id last and small. */
.org-decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem auto;
  align-items: center;
  text-align: start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--action-human-tint);
  border-inline-start: 3px solid var(--border-human);
}

.org-decision + .org-decision {
  border-block-start: 1px solid var(--border-interior);
}

.org-where,
.org-who {
  font-size: var(--fs-13);
  color: var(--action-human-ink);
}

.org-who {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.org-id {
  font-size: var(--fs-11);
  color: var(--text-secondary);
}

.org-question {
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
}

.org-question:hover {
  text-decoration: underline;
}

.org-card .card-head {
  gap: var(--space-3);
}

.org-open {
  margin-inline-start: auto;
}

.org-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-5);
}

.org-facts > div {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.org-fact {
  display: grid;
  gap: 2px;
}

.org-tip {
  font-size: var(--fs-11);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

@media (max-width: 48rem) {
  .org-decision {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .org-who {
    justify-content: flex-start;
  }
}

/* Keyboard shortcuts (views.shortcutsPanel): a card in the middle of the
   screen, opened by "?" or the account menu. */
.shell-shortcuts {
  position: fixed;
  inset: 0;
  margin: auto;
  inline-size: min(440px, calc(100vw - 2 * var(--space-4)));
  block-size: fit-content;
  padding: 0;
  border: 1px solid var(--border-structure);
  box-shadow: var(--elevation-pop, var(--elevation-card));
}

/* The kit's card sets display, which would beat the browser's own rule
   that hides a closed popover: say it again, so the panel is shut until
   it is opened. */
.shell-shortcuts:not(:popover-open) {
  display: none;
}

.shell-shortcuts .card-head > .btn {
  margin-inline-start: auto;
}

.shell-shortcut-list {
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.shell-shortcuts > *,
.shell-shortcut-list > div,
.shell-shortcut-list dd {
  max-inline-size: none;
}

.shell-shortcut-list > div {
  display: grid;
  grid-template-columns: minmax(5rem, 9rem) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}

.shell-shortcut-list dd {
  margin: 0;
}

.shell-shortcut-note {
  margin: 0;
  padding: 0 var(--space-5) var(--space-4);
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

.inbox-row[data-read] .inbox-row-title {
  font-weight: 400;
  color: var(--text-secondary);
}

/* Your profile (views.MePage). */
.me {
  display: grid;
  gap: var(--space-4);
  inline-size: 100%;
  max-inline-size: 720px;
  margin-inline: auto;
}

.me > .lbl {
  margin: 0;
}

.me .card-head {
  gap: var(--space-3);
}

.me .card > *,
.me-rows > div,
.me-rows dd {
  max-inline-size: none;
}

.me-rows {
  margin: 0;
}

.me-rows > div {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: 10px;
  border-block-end: 1px solid var(--border-interior);
}

.me-rows dt {
  color: var(--text-secondary);
}

.me-rows dd {
  margin: 0;
}

.me-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

/* The Queue's hand-written task sits behind a disclosure: most work comes
   from work items. */
.task-new-form > summary {
  cursor: pointer;
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

.task-new-form[open] > summary {
  margin-block-end: var(--space-4);
}

/* Not found (views.NotFoundPage). */
.notfound {
  display: grid;
  gap: var(--space-4);
  inline-size: 100%;
  max-inline-size: 640px;
  margin-inline: auto;
}

.notfound > .lbl {
  margin: 0;
}

/* Notifications: new ones stand out, read ones hide until asked for. */
.inbox-row:not([data-read]):not([data-held]) {
  background: color-mix(in oklab, var(--color-sys) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--color-sys);
}

.inbox-row:not([data-read]):not([data-held]) .inbox-row-title {
  font-weight: 600;
}

.inbox-new-dot {
  display: inline-block;
  inline-size: 8px;
  block-size: 8px;
  margin-inline-end: var(--space-2);
  border-radius: 50%;
  background: var(--color-sys);
  vertical-align: middle;
}

.inbox-show-read {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

.inbox:not(:has(input[name="inbox-show-read"]:checked)) .inbox-row[data-read] {
  display: none;
}

.inbox:not(:has(input[name="inbox-show-read"]:checked)) .inbox-group:not(:has(.inbox-row:not([data-read]))) {
  display: none;
}

.inbox:has(input[name="inbox-show-read"]:checked) [data-caught-up] {
  display: none;
}

/* People: members, and the add form in its dialog (views.PeoplePage).
   Members is one table, a row a person: their role is a select that saves
   as it changes (app/shell.js; its Save button is for a browser without
   scripts), and their account's actions are behind "…". */
.people-members { display: grid; gap: var(--space-3); margin-block-end: var(--space-5); }
.people-members-table { inline-size: 100%; }
.people-members-table td, .people-members-table th { vertical-align: middle; }
.people-email { font-size: var(--fs-13); color: var(--text-secondary); overflow-wrap: anywhere; }
:root[data-scripts] [data-autosave-fallback] { display: none; }
.people-workspaces { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.people-more { inline-size: 1%; text-align: end; white-space: nowrap; }
.people-menu { --pop-min-inline: 220px; --pop-max-inline: 280px; position-area: block-end span-inline-start; }
.people-menu form { margin: 0; }
.people-remove > summary { list-style: none; }
.people-remove > summary::-webkit-details-marker { display: none; }
.people-remove-form { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
.people-remove-form label { display: grid; gap: var(--space-1); }
.people-settings form.cluster { --cluster-gap: var(--space-2); }
.people-settings select.input { inline-size: auto; max-inline-size: 14rem; }
@media (max-width: 40rem) {
  .people-more { inline-size: 100%; text-align: start; }
}
.people-add { grid-template-columns: minmax(0, 1fr); }
/* A person's own page: their card's head wraps under the name. */
.people-member .card-head { flex-wrap: wrap; gap: var(--space-2); }
.people-member .card-head .card-identity { margin-inline-end: auto; }

/* A person's page: who they are, then Access, a row per role with its
   name, its select and Save (views/people_person.templ, personAccess). */
.person-detail { display: grid; gap: var(--space-4); }
.person-access-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.person-access-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.person-access-name { flex: 1 1 10rem; min-inline-size: 0; overflow-wrap: anywhere; }
.person-access-row select.input { inline-size: auto; max-inline-size: 16rem; }

/* People's drawer: a person's page over the list, full height and 480
   wide on the right, the whole screen on a phone (app/people-drawer.js),
   as the Rules drawer (app/rules.css) draws it. */
.people-drawer {
  --dlg-sheet-extent: 480px;
  --dlg-margin: 0px;
  --card-edge-width: 0;
  border-inline-start: 1px solid var(--border-structure);
  overflow: hidden;
}
.people-drawer-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  min-block-size: 48px;
  padding-block: var(--space-2);
  padding-inline: var(--space-5) var(--space-3);
  border-block-end: 1px solid var(--border-interior);
}
.people-drawer-title {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  font-size: var(--fs-14);
  font-weight: 500;
  line-height: 1.35;
}
.people-drawer-btn {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.people-drawer-btn:hover { color: var(--text-body); }
.people-drawer-btn > .glyph { fill: none; }
.people-drawer-body {
  flex: 1;
  min-block-size: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
}
.people-drawer-note { margin: 0; color: var(--text-secondary); }
html.people-drawer-open { overflow: hidden; }
@media (max-width: 40rem) {
  .people-drawer { --dlg-sheet-extent: 100%; border-inline-start: 0; }
  .people-drawer-body { padding: var(--space-4); }
}
.people-add-fields { display: grid; gap: var(--space-3); max-inline-size: 32rem; }
.people-add-fields label { display: grid; gap: var(--space-1); }
/* The add form's dialog (app/people-add.js opens it as a modal). */
.people-add-dlg { inline-size: min(32rem, 100%); }
.people-add-dlg .card-head { display: flex; align-items: center; gap: var(--space-2); }
.people-add-dlg .card-head .card-identity { margin-inline-end: auto; }
.people-add-dlg .people-add-fields { max-inline-size: none; }
/* The head and body sit inside the form, not straight in the card, so the
   kit's card padding misses them; give it back here. */
.people-add-dlg .people-add > .card-head {
  min-block-size: var(--card-head-block-size);
  padding-inline: var(--card-pad);
  border-block-end: 1px solid var(--card-head-seam);
}
.people-add-dlg .people-add > .card-body { padding: var(--card-body-pad-block) var(--card-pad); }
/* Someone who starts their own products gets only those, so "Where" means
   nothing for them; hide it while that role is picked. */
.people-add:has(select[name="role"] option[value="starter"]:checked) .people-add-where { display: none; }
.people-add-actions { justify-content: flex-end; }
/* Without the script, the head's link to #people-add, or a refused add,
   shows the form in the page instead. */
.people-add-dlg:not([open]):is([data-open], :has(#people-add:target)) {
  display: flex; position: static; margin: 0 0 var(--space-5); inline-size: auto;
}
.people-link { display: block; inline-size: 100%; overflow-wrap: anywhere; word-break: break-all; white-space: normal; padding: var(--space-2); border: 1px solid var(--border-structure); background: var(--surface-well); user-select: all; }

/* A notification that is a plain sentence ("Couldn't merge … · 3 days
   ago") has no letter before it, so its words take the whole row. */
.inbox-row:not(:has(> .avatar)) {
  grid-template-columns: minmax(0, 1fr);
}

.inbox-row-ago {
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Nothing is wider than the screen. On a phone (360px to 414px wide) no
   page scrolls sideways: long words, links, ids and mono lines wrap, grid
   and flex children may shrink below their content, and media, code and
   cards stay inside their column. The generic rules sit in the kit's reset
   layer, so a kit block that sets its own width or wrapping (a chip, a
   keycap, a count) still wins; the rules after it fix the kit blocks and
   app pieces that would not wrap. A table that must stay wide scrolls in a
   .scroller of its own. */
@layer reset {
  :where(.shell-page) :where(.card, table, dl, ul, ol, p, li, dd, dt, td, th, legend, h1, h2, h3, a, time, code, samp, .u-mono) {
    /* break-word, not anywhere: anywhere also shrinks a cell's smallest
       width, so a table column collapses to a letter wide on a phone. */
    overflow-wrap: break-word;
  }

  :where(.shell-page) :where(*:not(.btn, .chip, .keycap, .avatar, .count, .glyph, svg, input, select, button, textarea, kbd)) {
    min-inline-size: 0;
  }

  :where(.shell-page) :where(img, video, canvas, iframe, pre, code, table, .card, .scroller) {
    max-inline-size: 100%;
  }

  :where(.shell-page) :where(pre) {
    overflow-x: auto;
  }
}

/* The page's own frame never scrolls sideways, whatever a page holds. */
.shell-main,
.shell-page {
  min-inline-size: 0;
}

.shell {
  overflow-x: clip;
}

/* A browser without clip (Safari before 16) let a too-wide page widen the
   phone's screen, and the pinned header then drifted over the page as it
   scrolled. There the content clips itself, under the header, so the
   header's own row is never the one that scrolls. */
@supports not (overflow-x: clip) {
  .shell-main {
    overflow-x: hidden;
  }
}

.card {
  max-inline-size: 100%;
}

.chip {
  max-inline-size: 100%;
}

/* A chip that holds a sentence (a <p> saying what an action did, or why it
   did not) wraps like text and is never wider than the screen: the kit's
   chip is one short upper-case line, and on a phone the put-away result was
   832 px wide (newcomer walk 10). */
p.chip {
  display: block;
  inline-size: fit-content;
  max-inline-size: 100%;
  block-size: auto;
  min-block-size: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.4;
  padding-block: var(--space-1);
}

/* The kit's decision-card keeps each fact on one line; a deadline, a name
   or a work item's title wraps instead. */
.decision-facts {
  min-inline-size: 0;
}

.decision-fact {
  flex: 0 1 auto;
  max-inline-size: 100%;
}

.decision-fact > dd {
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
  min-inline-size: 0;
}

/* An agent is named with a small badge that says so. */
.agent-badge {
  font-size: var(--fs-10);
  padding-inline: var(--space-1);
  min-block-size: 0;
  line-height: 1.5;
  vertical-align: baseline;
}

@media (max-width: 40rem) {
  /* A form's label sits over its field, not beside it. */
  .field[data-layout="aside"] {
    --field-cols: minmax(0, 1fr);
    --field-areas: "label" "ctl" "msg";
    --field-ctl-space: var(--space-2);
    --field-label-min-block-size: auto;
  }

  /* A table in a card without a scroller of its own scrolls inside the
     card, never the page. */
  :is(.card, .card-body):has(> table) {
    overflow-x: auto;
  }

  /* The kit's full-width menus keep inside the screen. */
  .shell-menu {
    --pop-max-inline: calc(100vw - 2 * var(--space-4));
    --pop-min-inline: min(230px, calc(100vw - 2 * var(--space-4)));
  }
}

/* On a phone a list table stacks: each row is a card whose first cell (the
   title) runs the full width, and the other cells sit under it, each with
   its column's name from data-label. */
@media (max-width: 40rem) {
  /* The heads stay for screen readers, out of the layout: as a block of
     no size, so their cells never push the page sideways. */
  .tbl-stack thead { display: block; position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td, .tbl-stack tbody th { display: block; inline-size: 100%; }
  .tbl-stack tr { padding-block: var(--space-3); border-block-end: 1px solid var(--color-rule); }
  .tbl-stack td, .tbl-stack tbody th { block-size: auto; padding-block: var(--space-1); padding-inline: var(--space-3); border: 0; text-align: start; }
  .tbl-stack td:first-child, .tbl-stack tbody th:first-child { font-size: 1.05em; padding-block-end: var(--space-2); }
  /* A cell's name reads as a label, in the body face even beside a figure. */
  .tbl-stack td[data-label]:not(:first-child)::before { content: attr(data-label) " · "; color: var(--text-secondary, inherit); font-family: var(--font-body); font-size: 0.85em; }
  /* A cell that only helps on a wide screen stays off a phone. */
  .tbl-stack [data-wide-only] { display: none; }
}

/* app/live.js: the one note while the live connection is down. */
.live-note {
  position: fixed;
  inset-block-end: var(--space-3);
  inset-inline-start: var(--space-3);
  z-index: 50;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-structure);
  font-size: var(--fs-13);
  pointer-events: none;
}
.live-note[hidden] { display: none; }

/* app/live.js: the console updated after this page was drawn. A small bar,
   not in the way: the page goes on working under it. */
.update-bar {
  position: fixed;
  inset-block-end: var(--space-3);
  inset-inline-start: 50%;
  translate: -50% 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-inline-size: calc(100vw - 2 * var(--space-4));
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  background: var(--surface-card);
  color: var(--text-body);
  border: 1px solid var(--border-strong);
  box-shadow: var(--elevation-pop);
  font-size: var(--fs-13);
}
.update-bar[hidden] { display: none; }
.update-bar .update-bar-close { color: var(--text-secondary); }

/* The account menu's foot: the console version running. */
.shell-version-text { display: flex; flex-direction: column; gap: 2px; }
.shell-version .pop-item-meta { margin-inline-start: 0; }

/* A radio choice reads as one: a round mark with a round dot, so a set of
   them never looks like checkboxes (the kit draws every mark square). */
.choice[data-kind="radio"] > .choice-mark,
.choice[data-kind="radio"] > .choice-mark::before {
  border-radius: 50%;
}

.choice[data-kind="radio"] > .choice-mark {
  justify-content: center;
}

/* Notifications on this device (views/notify.templ). */
.notify-body,
.notify-email {
  display: grid;
  gap: var(--space-3);
}

.notify-status:empty {
  display: none;
}

.notify-actions {
  gap: var(--space-2);
}

.notify-devices {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.notify-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 8px;
  border-block-end: 1px solid var(--border-interior);
}

.notify-device > span {
  display: grid;
  gap: 2px;
}

.notify-email label {
  display: grid;
  gap: var(--space-2);
}

/* The phone's pieces (views/phone.templ), as the design system draws them
   (components/shell/PhoneFrame.jsx) and the client's phone screen uses them
   (client-screens.jsx C-05). None of them shows wider than a phone. */
.shell-tabbar,
.m-head {
  display: none;
}

@media (max-width: 40rem) {
  /* TabBar: the sections move from the tab row to the bottom edge. Glyph
     over label, 56px, the current one blue with a 2px rule on top; the
     home indicator's inset below it. */
  .shell-tabs {
    display: none;
  }

  .shell-tabbar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    block-size: calc(56px + env(safe-area-inset-bottom));
    padding-block-end: env(safe-area-inset-bottom);
    padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
    box-sizing: border-box;
    background: var(--surface-card);
    border-block-start: 1px solid var(--border-structure);
  }

  .shell-tabbar > a {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    min-inline-size: 0;
    color: var(--text-secondary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .shell-tabbar > a[aria-current="page"] {
    color: var(--action-primary);
    box-shadow: inset 0 2px 0 var(--action-primary);
  }

  .shell-tabbar .glyph {
    inline-size: 20px;
    block-size: 20px;
  }

  .shell-tabbar-label {
    max-inline-size: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 500 var(--fs-10) / 1 var(--font-body);
    letter-spacing: 0.02em;
  }

  .shell-tabbar-count {
    display: contents;
  }

  /* The count keycap: amber, as a held decision is everywhere. */
  .shell-tabbar .count {
    --count-bg: var(--action-human-fill);
    --count-fg: var(--text-on-human);
    position: absolute;
    inset-block-start: 6px;
    inset-inline-start: calc(50% + 6px);
    display: grid;
    place-items: center;
    block-size: 16px;
    min-inline-size: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    font: 500 9px / 1 var(--font-mono);
    background: var(--count-bg);
    color: var(--count-fg);
    box-shadow: 0 0 0 2px var(--surface-card);
  }

  .shell:has(.shell-tabbar) {
    padding-block-end: calc(56px + env(safe-area-inset-bottom));
  }

  .shell:has(.shell-tabbar) .live-note,
  .shell:has(.shell-tabbar) .update-bar {
    inset-block-end: calc(56px + env(safe-area-inset-bottom) + var(--space-3));
  }

  /* MobileHeader: a drilled-in page (a decision) has a 48px header of its
     own, Back on the left and its name in the middle, amber with a 2px edge
     when it waits on the viewer. The shell's rows give way to it; the tab
     bar stays on the bottom edge, as the design's decision screen keeps it
     under the pinned answer. */
  .shell:has(.m-head) .shell-header {
    display: none;
  }

  .shell:has(.m-head) .shell-main {
    padding-block-start: calc(48px + env(safe-area-inset-top) + var(--space-4));
  }

  .m-head {
    position: fixed;
    inset-inline: 0;
    inset-block-start: 0;
    z-index: 30;
    display: grid;
    /* Back's column grows to fit its word rather than squeezing it. */
    grid-template-columns: minmax(64px, max-content) minmax(0, 1fr) 64px;
    align-items: center;
    block-size: calc(48px + env(safe-area-inset-top));
    padding-block-start: env(safe-area-inset-top);
    box-sizing: border-box;
    background: var(--surface-card);
    border-block-end: 1px solid var(--border-structure);
  }

  .m-head[data-tone="human"] {
    background: var(--action-human-tint);
    border-block-end: 2px solid var(--action-human);
  }

  .m-head-back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    block-size: 44px;
    min-inline-size: 44px;
    padding: 0 8px;
    justify-self: start;
    color: var(--action-primary);
    font: 500 var(--fs-13) / 1 var(--font-body);
    text-decoration: none;
    /* The page's links may break a long word; Back stays on one line,
       shortened with an ellipsis when there is no room. */
    white-space: nowrap;
    overflow-wrap: normal;
    max-inline-size: 40vw;
  }

  .m-head-back > span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-head-back .glyph {
    inline-size: 18px;
    block-size: 18px;
  }

  .m-head-title {
    grid-column: 2;
    justify-self: center;
    max-inline-size: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: var(--fs-14);
    font-weight: 500;
    color: var(--text-body);
  }

  /* A tab's own title bar (client-screens.jsx C-05's Your turn): the
     page's name on the left, one action on the right. */
  .m-head[data-kind="title"] {
    grid-template-columns: minmax(0, 1fr) 44px;
    padding-inline: calc(16px + env(safe-area-inset-left)) calc(4px + env(safe-area-inset-right));
  }

  .m-head[data-kind="title"] .m-head-title {
    grid-column: 1;
    justify-self: start;
  }

  .m-head-action {
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    color: var(--action-primary);
  }

  .m-head-action .glyph {
    inline-size: 18px;
    block-size: 18px;
  }

  /* A worded action (a decision's Next), at the right end opposite Back. */
  .m-head-action[data-kind="text"] {
    display: inline-flex;
    gap: 2px;
    inline-size: auto;
    padding: 0 8px;
    justify-self: end;
    white-space: nowrap;
    text-decoration: none;
    font: 500 var(--fs-13) / 1 var(--font-body);
  }

  /* An answer pinned to the bottom (the decision's and the client's) sits
     on the tab bar, not over it. */
  .shell:has(.shell-tabbar) .dec-foot,
  .shell:has(.shell-tabbar) .client-foot {
    inset-block-end: calc(56px + env(safe-area-inset-bottom));
    padding-block-end: 12px;
  }

  .shell:has(.shell-tabbar):has(.dec-foot, .client-foot) {
    padding-block-end: calc(56px + 88px + env(safe-area-inset-bottom));
  }
}

/* A working run's chip (views.RunStatus): its dot pulses while the agent
   is at it, so a glance tells working from paused or stopped. */
.chip[data-pulse]:before {
  animation: chip-pulse 1.6s ease-in-out infinite;
}

@keyframes chip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .chip[data-pulse]:before {
    animation: none;
  }
}

/* An agent's picture (views.agentAvatar): its icon, or the picture
   uploaded for it, filling the kit's avatar at the kit's sizes. */
.agent-avatar {
  overflow: hidden;
}

.agent-avatar > img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.agent-avatar > .glyph {
  inline-size: 70%;
  block-size: 70%;
}

/* A name with an agent's picture before it, in a line of text. */
.work-who {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* What runs now (views.ActivityStrip): a quiet button in the header's
   actions, "2 building · 1 checking · 1 shipping · 3 waiting", that opens
   a small panel listing it in groups, each row with who is doing it, its
   timer and a link. Amber only when something is blocked. On a phone it
   is one count with a dot, and the panel opens full width, its rows
   wrapping rather than scrolling sideways. */
.shell-activity-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  block-size: 28px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-structure);
  background: var(--surface-card);
  color: var(--text-secondary);
  font: 400 var(--fs-11) / 1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}

.shell-activity-btn:hover {
  background: var(--surface-well);
}

.shell-activity-wide > span + span::before {
  content: " · ";
}

.shell-activity-dot {
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: var(--border-strong);
}

.shell-activity-btn[data-busy] .shell-activity-dot {
  background: var(--text-secondary);
  animation: chip-pulse 1.6s ease-in-out infinite;
}

/* Something blocked: the "waiting on a person" tone, never for ordinary
   waiting. */
.shell-activity-btn[data-blocked] {
  border-color: var(--border-human);
}

.shell-activity-btn[data-blocked] .shell-activity-dot {
  background: var(--action-human);
}

.shell-activity-btn[data-blocked] [data-kind="blocked"] {
  color: var(--action-human);
}

/* The flow watchdog's line: quiet while work flows, amber while a stall
   is seen (internal/flowwatch). */
.shell-activity-btn[data-stalled] {
  border-color: var(--border-human);
}

.shell-activity-btn[data-stalled] .shell-activity-dot,
.shell-activity-btn[data-stalled] .shell-activity-flow {
  color: var(--action-human);
}

.shell-activity-btn[data-stalled] .shell-activity-dot {
  background: var(--action-human);
}

.shell-activity-flow-row {
  display: block;
  margin: 0;
  padding: var(--space-1) var(--space-3) var(--space-2);
  color: var(--text-secondary);
  font-size: var(--fs-13);
  text-decoration: none;
}

.shell-activity-flow-row[data-stalled] {
  color: var(--action-human);
}

a.shell-activity-flow-row:hover {
  background: var(--surface-well);
}

/* Under the flow line: the PM bot's latest line, main failing a check
   (amber, with its Fix it now), and what the viewer's last change did. */
.shell-activity-note {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-1) var(--space-3) var(--space-2);
  color: var(--text-secondary);
  font-size: var(--fs-13);
  overflow-wrap: anywhere;
}

.shell-activity-note > p {
  margin: 0;
}

.shell-activity-note[data-stalled] {
  color: var(--action-human);
}

.shell-activity-note .btn {
  justify-self: start;
}

.shell-activity-narrow {
  display: none;
  font-family: var(--font-mono);
}

.shell-activity {
  --pop-pad: 0;
  --pop-min-inline: 340px;
  --pop-max-inline: 380px;
  max-block-size: 480px;
}

#activity {
  position-area: block-end span-inline-start;
}

.shell-activity-panel {
  display: grid;
  padding-block: var(--space-2);
}

.shell-activity-empty {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--fs-13);
}

.shell-activity-rows {
  margin: 0;
  padding: 0;
}

.shell-activity-group + .shell-activity-group {
  border-block-start: 1px solid var(--border-structure);
  margin-block-start: var(--space-1);
  padding-block-start: var(--space-1);
}

.shell-activity-group-head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-1) var(--space-3);
  color: var(--text-secondary);
  font: 500 var(--fs-11) / 1.4 var(--font-body);
}

.shell-activity-group[data-kind="blocked"] .shell-activity-group-head {
  color: var(--action-human);
}

.shell-activity-count {
  margin-inline-start: auto;
  font-family: var(--font-mono);
}

.shell-activity-who {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-inline-size: 0;
  color: var(--text-secondary);
  font-size: var(--fs-11);
  overflow-wrap: anywhere;
}

.shell-activity-who[data-active] .glyph {
  animation: chip-pulse 1.6s ease-in-out infinite;
}

.shell-activity-more > summary {
  padding: var(--space-1) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--fs-11);
  cursor: pointer;
}

.shell-activity-more > summary:hover {
  background: var(--surface-well);
}

.shell-activity-row {
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  color: var(--text-body);
  text-decoration: none;
}

.shell-activity-row:hover {
  background: var(--surface-well);
}

.shell-activity-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-13);
}

@media (prefers-reduced-motion: reduce) {
  .shell-activity-btn[data-busy] .shell-activity-dot,
  .shell-activity-who[data-active] .glyph {
    animation: none;
  }
}

@media (max-width: 40rem) {
  .shell-activity-wide {
    display: none;
  }

  .shell-activity-narrow {
    display: inline;
  }

  .shell-activity {
    --pop-min-inline: calc(100vw - 2 * var(--space-4));
    --pop-max-inline: calc(100vw - 2 * var(--space-4));
    overflow-x: hidden;
  }

  .shell-activity-title {
    white-space: normal;
    overflow-wrap: anywhere;
  }

}

/* What an item is doing now (views.NowLine): one quiet line under a
   card's title and in an item's head, its step, a timer the browser
   ticks, how long the step usually takes, and a thin bar for a step with
   a known count. Neutral while work goes on; amber only when a person
   must act. */
.work-now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--space-1);
  margin: 0;
  font: 400 var(--fs-11) / 1.4 var(--font-body);
  color: var(--text-secondary);
}

.work-now-text {
  color: var(--text-body);
  font-weight: 500;
}

.work-now time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.work-now-usual::before {
  content: "· ";
}

/* Why a card waits for a builder, under its line (work_waitwhy.go). */
.work-now-why {
  margin: 0;
  font: 400 var(--fs-11) / 1.4 var(--font-body);
  color: var(--text-secondary);
}

.work-now[data-tone="human"] .work-now-text {
  color: var(--action-human-ink);
}

.work-now-bar {
  flex-basis: 100%;
  appearance: none;
  block-size: 3px;
  inline-size: 100%;
  border: 0;
  background: var(--surface-well);
  color: var(--text-secondary);
}

.work-now-bar::-webkit-progress-bar {
  background: var(--surface-well);
}

.work-now-bar::-webkit-progress-value {
  background: var(--text-secondary);
}

.work-now-bar::-moz-progress-bar {
  background: var(--text-secondary);
}


/* An agent's list, in a report or a decision's context (views richText):
   a list, as it was written, rather than lines that start "- ". */
.rich-list {
  margin: 0;
  padding-inline-start: 1.25em;
  list-style: disc;
  white-space: normal;
}
.rich-list > li + li { margin-block-start: var(--space-1); }

/* What a command printed, in an agent's words (views richText, ```
   fenced): one folded block, opened to the lines as printed, which scroll
   inside it rather than widening the page. */
.rich-code {
  font-size: var(--fs-13);
  color: var(--text-secondary);
  white-space: normal;
}
.rich-code > summary {
  cursor: pointer;
  inline-size: fit-content;
}
.rich-code > pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-2) var(--space-3);
  max-block-size: 24rem;
  overflow: auto;
  background: var(--surface-well);
  border: 1px solid var(--border-interior);
  border-radius: var(--radius-1);
  font: var(--fs-13) / 1.5 var(--font-mono);
  color: var(--text-body);
  white-space: pre;
}

/* A page being fetched to draw in place (app/boost.js): the page dims a
   moment after the click, so a quick one shows no flicker. */
html.boost-loading .shell-main {
  opacity: 0.6;
  transition: opacity 120ms ease 150ms;
  cursor: progress;
}

/* The button of a form posted in place, while it is on its way
   (app/shell.js): a small turning ring after its words. */
button[data-busy]::after {
  content: "";
  display: inline-block;
  inline-size: 0.8em;
  block-size: 0.8em;
  margin-inline-start: var(--space-2);
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: busy-turn 0.7s linear infinite;
}

@keyframes busy-turn {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  button[data-busy]::after {
    animation: none;
    border-inline-end-color: currentColor;
    opacity: 0.5;
  }
}

/* A field's status in plain words (a model's "Ready."), after its hint:
   ordinary text that wraps, coloured by its tone. */
.field-now {
  overflow-wrap: anywhere;
}
.field-now[data-tone="pass"] {
  color: var(--color-pass);
}
.field-now[data-tone="warn"] {
  color: var(--color-human);
  font-weight: 600;
}

/* A field's status chip can be a sentence: it wraps inside the field
   rather than pushing a phone's page sideways. */
.field-msg .chip {
  max-inline-size: 100%;
  block-size: auto;
  padding-block: 2px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The sign-in banner above every page: one slim line. */
.banner.banner-slim {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  font-size: var(--fs-13);
}

.banner.banner-slim > .glyph {
  flex: none;
}

.banner.banner-slim > .banner-text {
  flex: 1;
  min-inline-size: 0;
}

.banner-slim-act {
  flex: none;
  font-weight: 600;
  color: var(--text-link);
}

/* A row of tabs that scrolls (reel) is never wider than where it sits: on
   a phone its tabs scroll inside it instead of pushing the page sideways. */
.tabs.reel {
  max-inline-size: 100%;
  min-inline-size: 0;
}

/* A page's heading that is hidden by u-visually-hidden stays hidden when the
   console moves focus to it on arrival (app/boost.js does, so a screen
   reader says where it is): the kit shows a hidden thing again while it has
   focus, which is for skip links, and made the Chat page's "Chat" heading
   appear above everything after a click through from another page. */
h1.u-visually-hidden:focus,
h1.u-visually-hidden:active {
  clip-path: inset(50%);
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  block-size: 1px;
  inline-size: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  outline: none;
}
