/* Abilian SBE on top of the Abilian Design System (ADS).
 *
 * Two layers, loaded after ads.css:
 *   1. Knobs: Abilian's brand, as in Abilian Analytics (abilian.com: its logo's
 *      colours, Figtree for text, Barlow Condensed for figures and the product's name).
 *   2. A thin app layer, `sbe-*` classes, for what ADS doesn't have yet. Each one that
 *      waits for ADS says so, with the number of its request in notes/ux/ads-requests.md.
 *
 * Direction: dense and calm, not bland. Colour has a job: the brand's navy for the
 * interface and for strong text, the logo's blue for what's new, its pink for what's
 * wrong, a deepened cyan for what's right; then three kinds of identity, each from one
 * small palette: a colour per community, a tint per person, a colour per file type.
 */

/* --- Fonts: self-hosted (SIL OFL) --- */

@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap; src: url("fonts/figtree.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("fonts/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); }

/* --- 1. Knobs ---------------------------------------------------------------------- */

:root {
  --ads-brand: #0f3269;          /* the wordmark's navy */
  --ads-info: #2986ff;           /* the logo's blue: data */
  --ads-success: #00a3ad;        /* the logo's cyan, deepened to read as text */
  --ads-danger: #e8305f;         /* the logo's pink (#ff4a77), deepened to carry white text */
  --ads-warning: #ec8a00;
  --ads-neutral-hue: 222;        /* greys leaning towards the navy */
  --ads-neutral-chroma: 1.8;     /* enough that dark text reads navy, not black */
  --ads-radius-scale: 1.33;
  --ads-shadow-strength: .35;    /* borders carry the structure, not shadows */
  --ads-font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ads-text-base: .9375rem;
  --ads-weight-normal: 450;
  --ads-weight-medium: 550;
  --ads-weight-bold: 600;
  /* Muted text at AAA (7:1) in light mode; at ADS's default it fails AA. */
  --ads-contrast: 1.5;
  /* Sentence case for small labels: Abilian's voice. */
  --ads-label-case: none;
  --ads-label-tracking: normal;
  /* A flat page: surfaces on white rather than cards on grey. */
  --ads-page-contrast: 0;
  --ads-font-figures: "Barlow Condensed", var(--ads-font);
  /* Controls a step denser than ADS's default: buttons and fields about 35 pixels high
     rather than 44, with less room on their sides. */
  --ads-control-pad-y: calc(var(--ads-space-2) - 2px);
  --ads-control-pad-x: var(--ads-space-3);
  --ads-control: calc(var(--ads-line-control) + 2 * var(--ads-control-pad-y) + 2 * var(--ads-border-width));
  /* Strong text (headings, bold titles) in the wordmark's navy rather than near-black:
     the brand where the eye lands, and softer than black on white (12:1). ADS derives
     it from the neutral ramp, with no knob for its hue (ADS request 7). */
  --ads-ink-strong: light-dark(var(--ads-brand), var(--ads-n-0));
  /* A column on the right of the content needs the content to keep 46rem: it fits
     beside a bar or a rail on a laptop, and goes under the content on a tablet or
     beside a full menu (ADS's default, 30rem, keeps it beside down to 784 pixels). */
  --ads-main: 46rem;
  /* Links in the navy itself: `--ads-contrast` darkens the brand's ink by 37%, which
     takes a colour already at 12:1 on white to near-black (ADS request 7). */
  --ads-brand-ink: light-dark(var(--ads-brand),
      color-mix(in oklab, var(--ads-brand) 25%, white));

  /* Identity: one palette of eight, from the logo's colours outwards. Muted, of
     similar weight, none of them the semantic colours' exact shades, so that identity
     never reads as state. Each carries white text (4.5:1 or more). */
  --sbe-id-1: #2f5fb3;   /* blue */
  --sbe-id-2: #00808a;   /* teal, the logo's cyan deepened */
  --sbe-id-3: #c2405b;   /* rose, the logo's pink deepened */
  --sbe-id-4: #6a4fb8;   /* violet */
  --sbe-id-5: #a35f10;   /* amber */
  --sbe-id-6: #3b7d46;   /* green */
  --sbe-id-7: #8a4a8f;   /* plum */
  --sbe-id-8: #4a6175;   /* slate */
}

.sbe-id-1 { --sbe-id: var(--sbe-id-1); }
.sbe-id-2 { --sbe-id: var(--sbe-id-2); }
.sbe-id-3 { --sbe-id: var(--sbe-id-3); }
.sbe-id-4 { --sbe-id: var(--sbe-id-4); }
.sbe-id-5 { --sbe-id: var(--sbe-id-5); }
.sbe-id-6 { --sbe-id: var(--sbe-id-6); }
.sbe-id-7 { --sbe-id: var(--sbe-id-7); }
.sbe-id-8 { --sbe-id: var(--sbe-id-8); }

/* A community's current tab wears its colour, its tile's, as a band along the top: one
   knows where one is at a glance, and identity still never reads as state. */
.sbe-tabs-tinted .ads-tab[aria-current] { box-shadow: inset 0 3px var(--sbe-id); }

/* An avatar keeps its size in a row: ADS's can shrink, and a crowded row squeezed
   it into an oval (ADS request 25). */
.ads-avatar { flex: none; }

/* A person: initials on a tint of their colour, in its ink. A photo, when there is
   one, replaces both. */
.ads-avatar.sbe-person {
  /* in light mode, the colour darkened by a fifth: initials at 5.4:1 or more */
  color: light-dark(color-mix(in srgb, var(--sbe-id) 80%, black), color-mix(in oklab, var(--sbe-id) 45%, white));
  background: color-mix(in srgb, var(--sbe-id) 16%, var(--ads-surface));
  box-shadow: none;
}

/* A community: its initial on its colour, a rounded square, like its image when it
   has one. Squares for places, circles for people. */
.sbe-tile {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--ads-control-md);
  height: var(--ads-control-md);
  font-weight: var(--ads-weight-bold);
  color: #fff;
  background: var(--sbe-id);
  border-radius: var(--ads-radius);
}
.sbe-tile--lg {
  width: var(--ads-control-lg);
  height: var(--ads-control-lg);
  font-size: var(--ads-text-lg);
}
.sbe-tile--sm {
  width: 1.25rem;
  height: 1.25rem;
  font-size: var(--ads-text-xs);
  border-radius: var(--ads-radius-sm);
}

/* A file's type, by the colours office suites use: what a reader recognises before
   reading the name. */
.sbe-filetype { display: inline-flex; flex: none; color: var(--ads-ink-muted); }
.sbe-filetype--pdf { color: light-dark(#c2303f, #f07a85); }
.sbe-filetype--text { color: light-dark(#2f5fb3, #8fb0ee); }
.sbe-filetype--sheet { color: light-dark(#2e7d4a, #7fcc96); }
.sbe-filetype--slides { color: light-dark(#b85c12, #f0a868); }
.sbe-filetype--image { color: light-dark(#6a4fb8, #b4a2ee); }
.sbe-filetype--folder { color: light-dark(#a35f10, #e9b46a); }

/* --- 2. App layer -------------------------------------------------------------------- */

/* An icon in a button at the height of its line of text: Tabler draws at 24 pixels,
   taller than the line, and the button grew by the difference (ADS request 22). */
.ads-btn .ads-icon { width: 1.25em; height: 1.25em; }

/* Text for screen readers only: the name of a table's column of actions. */
.sbe-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A link inside a sentence keeps its underline: ADS removes it from every link in a
   card's head, which leaves "3 nouveaux messages" told apart by its colour alone
   (ADS request 24). */
.ads-card__head .ads-muted a:not(.ads-btn) { text-decoration: underline; }

/* `<strong>` and `<b>` at the theme's bold, not the browser's 700 (ADS request 9). */
:where(strong, b) { font-weight: var(--ads-weight-bold); }

/* The flat page puts ADS's page colour on the surface: the bar keeps a ground of its
   own, a wash of the brand's navy rather than a grey (ADS request 2). */
.ads-sidebar { background: color-mix(in srgb, var(--ads-brand) 6%, var(--ads-surface)); }

/* The product's name, set like Abilian's headings. */
.sbe-brandname {
  font-family: var(--ads-font-figures);
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--ads-brand-ink);
}

/* A table's main cell that truncates rather than wraps, as in a file manager: with
   `ads-full` it takes the room the other cells leave, and `max-width: 0` stops its
   content from widening the table (ADS request 10). */
.ads-table td.sbe-cell-truncate { max-width: 0; }

/* The single bar (`ads-app--horizontal`, its second bar removed), in four zones: who
   we are, where to go, what to do, the utilities. One rhythm: every control the height
   of a button; small gaps inside a zone, larger ones between zones. */
.ads-app--horizontal .sbe-primary { flex: none; }
/* A lower bar: ADS gives the brand a row of 12 pixels above and below; 10 (ADS
   request 13). */
.ads-app--horizontal .ads-brand { padding-block: calc(var(--ads-space-2) + 2px); }
.sbe-primary .ads-nav__list { flex-wrap: nowrap; gap: var(--ads-space-1); }
.sbe-primary :is(.ads-nav__link, .ads-dropdown > summary) {
  position: relative;
  min-height: var(--ads-control-md);
  padding: 0 var(--ads-space-3);
}
.sbe-primary .ads-dropdown > summary[aria-current] {
  background: var(--ads-brand-wash);
  font-weight: var(--ads-weight-medium);
}
.sbe-caret { width: 1em; height: 1em; color: var(--ads-ink-muted); }

/* Tooltips in the bar open downwards: above it is the window's edge (ADS request 17).
   The navigation's own only show once its names are hidden (below). */
.ads-app--horizontal .ads-sidebar .ads-tip::after { inset-block: calc(100% + var(--ads-space-2)) auto; }
.sbe-primary .ads-tip:is(:hover, :focus-visible)::after { display: none; }

/* What to do: the search takes the room left; "Créer" stands well apart from it, so
   that the two don't read as one control. */
.sbe-bar-do {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ads-space-8);
  min-width: 0;
}
/* Buttons in the bar at the height of its other controls. */
:is(.sbe-bar-do, .sbe-bar-utilities) .ads-btn { min-height: var(--ads-control-md); padding-block: 0; }
.sbe-search { flex: 0 1 26rem; flex-wrap: nowrap; min-width: 9rem; }
.sbe-search > .ads-icon { flex: none; color: var(--ads-ink-muted); }
.sbe-search > .ads-chip { flex: none; }
/* The search's scope, a ticked box drawn as a chip: unticked, it reads as set aside. */
.sbe-scope { max-width: 10rem; cursor: pointer; }
.sbe-scope:has(> input:not(:checked)) { text-decoration: line-through; opacity: .6; }
.sbe-scope:has(> input:focus-visible) { outline: 2px solid var(--ads-brand); outline-offset: 2px; }
/* The search page's own field, as wide as it can be. */
.sbe-search-field { flex: 1 1 auto; }
.sbe-search > input { min-width: 0; }
.sbe-bar-search { display: none; }

/* The utilities: three icons in one group, on a ground of their own (applications,
   notifications, the theme), then the account. A count sits on the icon's corner,
   where a named entry has it after its name. */
.sbe-bar-utilities { display: flex; flex: none; align-items: center; gap: var(--ads-space-3); }
.sbe-bar-icon {
  position: relative;
  justify-content: center;
  width: var(--ads-control-md);
  padding: 0;
}
.sbe-bar-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--ads-sunken);
  border-radius: var(--ads-radius);
}
.sbe-bar-icons .sbe-bar-icon {
  width: calc(var(--ads-control-md) - 4px);
  min-height: calc(var(--ads-control-md) - 4px);
}
.sbe-bar-icons .sbe-bar-icon:hover { background: var(--ads-surface); }
.sbe-bar-icon .ads-icon { width: 1.25rem; height: 1.25rem; }
/* A count of what's new, compact, right after its icon and raised against it, as an
   exponent: it takes its own room, so that it crowds neither the icon nor what follows. */
.sbe-count {
  position: relative;
  inset-block-start: -.5em;
  min-width: 1.125rem;
  height: 1.125rem;
  margin-inline-start: calc(-1 * var(--ads-space-2) - 3px);
  padding: 0 .25rem;
  justify-content: center;
  font-size: .6875rem;
  line-height: 1;
  border-radius: var(--ads-radius-pill);
}
/* An icon button with a count widens to hold it. */
.sbe-bar-icons .sbe-bar-icon:has(.sbe-count) { width: auto; padding-inline: var(--ads-space-2); }

/* The theme button shows the moon in light mode, the sun in dark mode. */
.sbe-when-dark { display: none; }
:root[data-theme="dark"] .sbe-when-dark { display: inline-flex; }
:root[data-theme="dark"] .sbe-when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sbe-when-dark { display: inline-flex; }
  :root:not([data-theme="light"]) .sbe-when-light { display: none; }
}

/* Menus stand apart from the page. With the theme's faint shadows, ADS's overlay
   shadow barely shows on white: a hairline edge and a shadow of their own. One line
   per item, the menu as wide as its longest, up to a limit (ADS request 18). */
.ads-menu {
  max-width: min(26rem, calc(100vw - 2 * var(--ads-space-2)));
  box-shadow:
    0 0 0 var(--ads-border-width) var(--ads-line),
    0 4px 8px -4px color-mix(in srgb, var(--ads-shadow-color) 12%, transparent),
    0 14px 32px -8px color-mix(in srgb, var(--ads-shadow-color) 22%, transparent);
}
.ads-menu__item { white-space: nowrap; }

/* Menus: the communities' opens under its trigger; headings, a filter, a check for
   the setting in force. */
.sbe-primary .ads-menu { inset-inline-start: 0; inset-inline-end: auto; }
.sbe-menu-wide { min-width: 20rem; }
.sbe-menu-search { margin: var(--ads-space-2) var(--ads-space-3); }
.sbe-menu-heading { margin: var(--ads-space-3) var(--ads-space-3) var(--ads-space-1); }
.sbe-inline { display: inline-flex; align-items: center; vertical-align: middle; }
.sbe-check { color: var(--ads-brand-ink); }
.sbe-check-off { visibility: hidden; }

/* "Créer": each kind an icon on a tile of the brand's wash, its name, one line on
   what it is for. */
.sbe-menu-create { min-width: 20rem; padding-block-end: var(--ads-space-2); }
.sbe-kind { gap: var(--ads-space-3); }
.sbe-kind__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--ads-control-md);
  height: var(--ads-control-md);
  color: var(--ads-brand-ink);
  background: var(--ads-brand-wash);
  border-radius: var(--ads-radius);
}
.sbe-kind__text { display: grid; }
.sbe-kind__label { font-weight: var(--ads-weight-medium); }
.sbe-kind .ads-muted { font-size: var(--ads-text-sm); }

/* A toolbar row in a card, under its head: a filter, a count, a choice of view. */
.sbe-toolbar { display: flex; align-items: center; gap: var(--ads-space-3); }
.sbe-toolbar > .ads-input-icon { flex: 0 1 15rem; min-width: 0; }
.sbe-toolbar > .ads-muted { white-space: nowrap; }
.ads-card > .sbe-toolbar {
  padding: var(--ads-space-2) var(--ads-space-5);
  border-block-end: var(--ads-border-width) solid var(--ads-line-soft);
}

/* The applications launcher: a grid of tiles, an icon over its name. */
.sbe-apps {
  display: grid;
  grid-template-columns: repeat(3, 6rem);
  gap: var(--ads-space-1);
  padding: var(--ads-space-2);
}
.sbe-apps > a {
  display: grid;
  justify-items: center;
  gap: var(--ads-space-1);
  padding: var(--ads-space-3) var(--ads-space-1);
  font-size: var(--ads-text-sm);
  color: var(--ads-ink);
  text-align: center;
  text-decoration: none;
  border-radius: var(--ads-radius);
}
.sbe-apps > a:hover { background: var(--ads-sunken); }
.sbe-apps__icon { display: inline-flex; color: var(--ads-brand-ink); }

/* Under 1280 pixels the navigation's names don't fit beside the search: each entry
   keeps its icon, its count moves to the icon's corner, a tooltip gives its name, and
   the name stays for screen readers. */
@media (max-width: 79.99em) {
  /* the product's name goes too, kept for screen readers: it names the logo's link */
  .sbe-nav-label,
  .ads-app--horizontal .sbe-brandname {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sbe-primary :is(.ads-nav__link, .ads-dropdown > summary) { padding-inline: var(--ads-space-2); }
  .sbe-primary .ads-tip:is(:hover, :focus-visible)::after { display: block; }
}

/* Under 1024 pixels the labels of buttons that have an icon go ("Créer", the
   community's actions). A column beside the content moves under it, so the button that
   hides the column would only hide the comments: it goes too. */
@media (max-width: 63.99em) {
  .sbe-wide-only,
  .sbe-doc .sbe-toggle { display: none; }
  .sbe-bar-do { gap: var(--ads-space-4); }
  /* ADS's bar spaces its parts for a laptop (ADS request 13). */
  .ads-app--horizontal .ads-sidebar__inner { gap: var(--ads-space-3); padding-inline: var(--ads-space-3); }
}

/* On a phone, where to go moves to a bar at the bottom of the screen, each entry an
   icon over its name, as in phone applications; the search becomes an icon. */
@media (max-width: 47.99em) {
  .sbe-search { display: none; }
  .sbe-bar-search { display: inline-flex; }
  .sbe-nav-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .sbe-primary {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    /* under ADS's backdrop (20), so a dialog covers it */
    z-index: 15;
    background: var(--ads-surface);
    box-shadow: 0 calc(-1 * var(--ads-border-width)) 0 0 var(--ads-line);
  }
  .sbe-primary .ads-nav__list { justify-content: space-around; }
  .sbe-primary .ads-nav__list > li { position: relative; }
  .sbe-primary :is(.ads-nav__link, .ads-dropdown > summary) {
    flex-direction: column;
    gap: 0;
    padding: var(--ads-space-1) var(--ads-space-2);
    font-size: var(--ads-text-xs);
  }
  .sbe-primary .sbe-caret { display: none; }
  .sbe-primary .sbe-count {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: calc(50% + var(--ads-space-1));
    margin: 0;
  }
  .sbe-primary .ads-tip:is(:hover, :focus-visible)::after { display: none; }
  /* the communities menu opens upwards, across the screen */
  .sbe-primary .ads-dropdown { position: static; }
  .sbe-primary .ads-menu { position: fixed; inset-inline: var(--ads-space-2); inset-block: auto 4.25rem; }
  .ads-app--horizontal .ads-page-body { padding-block-end: 4.5rem; }
  /* A file's name may take two lines in a table, which keeps only the date beside it:
     on one line, the minor columns gone, it was cut to a letter or two. */
  /* Selecting several files is for a larger screen; a row's ⋯ menu stays. */
  .ads-datatable .ads-table__select { display: none; }
  .sbe-cell-truncate .ads-truncate {
    display: -webkit-box;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  /* A page's menus too: anchored to their button's end, a wide menu runs off the
     left of a narrow screen. Fixed, with no top, a menu stays under its button and
     spans the screen. */
  :is(.ads-page-header, .ads-page-body) .ads-menu {
    position: fixed;
    inset-inline: var(--ads-space-2);
    inset-block-start: auto;
    min-width: 0;
    max-width: none;
  }
  /* the bar's other menus open downwards, across the screen */
  :is(.sbe-bar-do, .sbe-bar-utilities) .ads-menu {
    position: fixed;
    inset-inline: var(--ads-space-2);
    inset-block: 3.5rem auto;
    min-width: 0;
    max-width: none;
  }
  /* ADS scrolls the bar sideways on a phone, which hides its menus; it fits (ADS
     request 13). */
  .ads-app--horizontal .ads-sidebar__inner { gap: var(--ads-space-2); padding-inline: var(--ads-space-2); overflow: visible; }
  .sbe-bar-do { gap: var(--ads-space-2); }
}

/* A tree entry with an icon: the icon and the name side by side, centred on one line
   (ADS request 19). */
a.ads-tree__label { display: flex; align-items: center; gap: var(--ads-space-2); }

/* A button that switches something on the page: a checkbox inside a label drawn as a
   button, the page reacting with `:has()`, no script. The box is hidden but keeps the
   focus, which shows on the button. */
.sbe-toggle { cursor: pointer; }
.sbe-toggle > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sbe-toggle:has(> input:focus-visible) { outline: 2px solid var(--ads-brand); outline-offset: 2px; }
.sbe-toggle > input:checked ~ .sbe-toggle__off,
.sbe-toggle > input:not(:checked) ~ .sbe-toggle__on { display: none; }
.sbe-toggle > span { display: inline-flex; align-items: center; gap: var(--ads-space-2); }

/* A document's page: its details beside it, until the reader gives the document the
   whole width. */
.sbe-doc:has(.sbe-toggle > input:checked) > aside { display: none; }
/* Its preview: a page on a sunken ground, as a sheet on a desk. */
.sbe-preview {
  display: grid;
  place-items: center;
  padding: var(--ads-space-4);
  min-height: 12rem;
  background: var(--ads-sunken);
  border-radius: var(--ads-radius);
}
.sbe-preview > img { max-width: 100%; height: auto; box-shadow: var(--ads-shadow-sm); }
/* A comment is plain text: its line breaks are the author's, its long words wrap. */
.sbe-comment { white-space: pre-line; overflow-wrap: anywhere; }

/* Feeds: where to start a discussion, then entries. An entry's title, a few lines of
   what it says, the latest replies on one line each. */
.sbe-composer { display: flex; align-items: center; gap: var(--ads-space-2); }
/* From Mon fil, the prompt opens the list of one's communities. */
.sbe-composer__pick { flex: 1 1 auto; min-width: 0; }
.sbe-composer__pick > summary { list-style: none; }
.sbe-composer__pick > summary::-webkit-details-marker { display: none; }
.sbe-prompt {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: var(--ads-ink-muted);
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: text;
}
.sbe-entry__title { margin: 0; font-size: var(--ads-text-lg); }
/* A link that reads as text until hovered: a title, a community's name in a byline. */
a.sbe-quiet { color: inherit; text-decoration: none; }
a.sbe-quiet:hover { text-decoration: underline; }
.sbe-excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.sbe-replies {
  padding-inline-start: var(--ads-space-3);
  border-inline-start: 2px solid var(--ads-line);
}
.sbe-replies > li { gap: var(--ads-space-2); }

/* Two lines beside an icon, a tile or an avatar, about as tall as it: a name, then
   its details, smaller, with no gap between them. */
.sbe-lines { display: grid; grid-template-columns: minmax(0, 1fr); line-height: 1.3; }
.sbe-lines > .ads-muted { font-size: var(--ads-text-sm); }
/* A name on two lines at most, then an ellipsis: file names often differ only at their
   end ("v1", "v3"), which a one-line ellipsis hides. */
.sbe-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* A date as a small calendar leaf: the day over the month. */
.sbe-date {
  display: grid;
  flex: none;
  place-content: center;
  width: 3rem;
  height: 3rem;
  font-size: var(--ads-text-xs);
  line-height: 1.1;
  text-align: center;
  color: var(--ads-brand-ink);
  background: var(--ads-brand-wash);
  border-radius: var(--ads-radius);
}
.sbe-date strong { font-family: var(--ads-font-figures); font-size: var(--ads-text-lg); }
.sbe-date--sm { width: 2.25rem; height: 2.25rem; }
.sbe-date--sm strong { font-size: var(--ads-text); }

/* The folders' tree: a folder with subfolders opens and closes with the button before
   its name, a `<details>` that holds only its summary; the list of subfolders follows
   it and shows when it is open. ADS's tree has no such button (ADS request 21). */
.sbe-tree__row { display: flex; align-items: center; gap: var(--ads-space-1); }
.sbe-tree__toggle { flex: none; width: 1.25rem; }
.sbe-tree__toggle > summary {
  display: grid;
  place-items: center;
  height: 1.25rem;
  color: var(--ads-ink-muted);
  list-style: none;
  cursor: pointer;
  border-radius: var(--ads-radius-sm);
}
.sbe-tree__toggle > summary::-webkit-details-marker { display: none; }
.sbe-tree__toggle > summary:hover { background: var(--ads-sunken); }
.sbe-tree__toggle > summary .ads-icon { width: 1rem; height: 1rem; transition: rotate .12s; }
.sbe-tree__toggle[open] > summary .ads-icon { rotate: 90deg; }
.sbe-tree .ads-tree__node > .ads-tree--nested { display: none; }
.sbe-tree .ads-tree__node:has(> .sbe-tree__row > .sbe-tree__toggle[open]) > .ads-tree--nested { display: block; }
.sbe-tree__row > .ads-tree__label { flex: 1; min-width: 0; }
/* The folder shown. ADS's tree marks nothing current (ADS request 27). */
.sbe-tree .ads-tree__label[aria-current] {
  color: var(--ads-ink-strong);
  font-weight: var(--ads-weight-medium);
  background: var(--ads-brand-wash);
  border-radius: var(--ads-radius-sm);
}

/* The rich-text editor's frame (Tiptap fills the body): a row of tools, the text. ADS
   draws the box and leaves the toolbar to the vendor's adapter. */
.sbe-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: var(--ads-space-1);
  border-block-end: var(--ads-border-width) solid var(--ads-line-soft);
  background: var(--ads-sunken);
}
.sbe-editor__sep { width: var(--ads-border-width); height: 1.25rem; margin-inline: var(--ads-space-1); background: var(--ads-line); }
.sbe-editor__body { min-height: 10rem; padding: var(--ads-space-3); }
.sbe-editor__body:focus { outline: none; }
/* Tiptap's own box: the editor's frame shows the focus already (`.ads-editor:focus-within`). */
.sbe-editor__body .ProseMirror { min-height: 8rem; outline: none; }

/* A drop zone inside a form: one line rather than a panel. */
.ads-dropzone.sbe-dropzone--compact {
  display: flex;
  justify-content: center;
  gap: var(--ads-space-2);
  padding: var(--ads-space-4);
}

/* Files on their way: a row each, its state under its name. */
.sbe-uploads > li { gap: var(--ads-space-3); }
.sbe-uploads .ads-progress { margin-block-start: var(--ads-space-1); }
/* A file ticked to be removed when the page is saved. */
.sbe-uploads > li:has(.sbe-toggle > input:checked) .sbe-lines { text-decoration: line-through; color: var(--ads-ink-muted); }
.sbe-upload__options { margin-block-start: var(--ads-space-1); font-size: var(--ads-text-sm); }
.sbe-upload__error { display: inline-flex; align-items: center; gap: var(--ads-space-1); font-size: var(--ads-text-sm); }
.sbe-ok { color: var(--ads-success-ink); }
.sbe-upload__preview { width: 2.5rem; height: 2.5rem; object-fit: cover; border-radius: var(--ads-radius-sm); }

/* A group of choices with its legend as a label, without the browser's frame. */
.sbe-fieldset { margin: 0; padding: 0; border: 0; }

/* A dialog with a list in it: wider than ADS's 32rem. */
.ads-modal__panel.sbe-modal-wide { max-width: 40rem; }
/* A note in a dialog's foot takes a line of its own when the buttons leave it no room. */
.ads-modal__foot > .ads-muted { flex: 1 1 14rem; }

/* Search results: a kind's icon, the title, where it is, the words found marked. */
.sbe-results > li { align-items: flex-start; gap: var(--ads-space-3); }
.sbe-result__icon { display: inline-flex; flex: none; padding-block-start: 2px; color: var(--ads-ink-muted); }
.sbe-result__title { font-weight: var(--ads-weight-bold); }
.sbe-results mark { color: inherit; background: color-mix(in srgb, var(--ads-warning) 22%, transparent); border-radius: 2px; }

/* A heading over a run of cards, as a card's title is over its body. */
.sbe-section-title { margin: 0; font-size: var(--ads-text-md); color: var(--ads-ink-strong); }

/* A person's title and organisation under their name in a page's heading. */
.sbe-profile__title { font-size: var(--ads-text); font-weight: var(--ads-weight-normal); }

/* A native <dialog> (opened by vite/src/modals.js) drawn as ADS's modal panel: the
   browser supplies the backdrop, focus trapping and Escape. */
dialog.sbe-dialog { padding: 0; border: 0; }
dialog.sbe-dialog::backdrop { background: color-mix(in srgb, var(--ads-n-950) 45%, transparent); }

/* Adapter: the app's upload widget (vite/src/widgets/file.js), which builds each
   file's row itself, with its own class names, until the forms move to ADS. */
.sbe-uploader { display: grid; gap: var(--ads-space-2); justify-items: start; }
.sbe-uploader__list { display: grid; gap: var(--ads-space-1); width: 100%; }
.sbe-uploader__list .file-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ads-space-2);
  padding: var(--ads-space-2) var(--ads-space-3);
  border: var(--ads-border-width) solid var(--ads-line);
  border-radius: var(--ads-radius);
}
.sbe-uploader__list .file-info { flex: 1; min-width: 0; }
.sbe-uploader__list .close { color: var(--ads-ink-muted); text-decoration: none; }
.sbe-uploader__list .progress { flex-basis: 100%; overflow: hidden; background: var(--ads-line); border-radius: var(--ads-radius-sm); }
.sbe-uploader__list .progress-bar { height: 100%; background: var(--ads-brand); }
/* A file already saved, marked to be removed when the message is. */
.sbe-uploader__list .file-item:has([aria-pressed="true"]) .file-info { color: var(--ads-ink-muted); text-decoration: line-through; }

/* A sorted column says which way in its header (`aria-sort`, where assistive technology
   reads it); ADS draws the arrow from the link's own attribute. The arrow is decoration,
   with an empty alternative text: otherwise it is read as part of the link's name
   ("Name up down arrow"). ADS request 26. */
.ads-th-sort::after { content: "↕" / ""; }
th[aria-sort="ascending"] > .ads-th-sort::after { content: "↑" / ""; opacity: 1; }
th[aria-sort="descending"] > .ads-th-sort::after { content: "↓" / ""; opacity: 1; }

/* A folder as tiles: a preview of each document, the box to tick it in a corner. */
/* auto-fill, not ADS's auto-fit: two tiles keep a tile's width instead of sharing the row. */
.sbe-gallery {
  grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr));
  list-style: none;
  margin: var(--ads-space-3) 0 0;
  padding: 0;
}
.sbe-gallery__item { position: relative; overflow: hidden; }
.sbe-gallery__select { position: absolute; inset: var(--ads-space-2) auto auto var(--ads-space-2); width: auto; }
.sbe-gallery__preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--ads-sunken);
  border-block-end: var(--ads-border-width) solid var(--ads-line);
}
.sbe-gallery__preview img { width: 100%; height: 100%; object-fit: cover; }
.sbe-gallery__preview .ads-icon { width: 3rem; height: 3rem; }

/* Adapter: the user picker (vite/src/picker.js, combobox.js), which builds its list of
   suggestions itself, until ADS's combobox takes its place. */
.picker { position: relative; display: block; }
.combobox-results {
  position: absolute;
  z-index: 30;
  inset-inline-start: 0;
  top: 100%;
  width: 100%;
  max-height: 20rem;
  margin: var(--ads-space-1) 0 0;
  padding: var(--ads-space-1) 0;
  overflow-y: auto;
  list-style: none;
  background: var(--ads-surface);
  border: var(--ads-border-width) solid var(--ads-line);
  border-radius: var(--ads-radius);
  box-shadow: var(--ads-shadow-overlay);
}
.combobox-hit { padding: var(--ads-space-1) var(--ads-space-3); cursor: pointer; }
.combobox-hit:hover, .combobox-hit.is-active { background: var(--ads-brand-wash); }
.combobox-group { padding: var(--ads-space-2) var(--ads-space-3) var(--ads-space-1); font-size: var(--ads-text-xs); color: var(--ads-ink-muted); }
.picker-role { float: inline-end; font-size: var(--ads-text-xs); color: var(--ads-ink-muted); }
.picker-email { font-size: var(--ads-text-xs); color: var(--ads-ink-muted); }

/* --- Drawn in the mockups, for the pages still to move ------------------------------ */

/* Signing in: the brand above the card. */
.sbe-brand-centered { display: inline-flex; align-items: center; gap: var(--ads-space-2); text-decoration: none; }

/* A wiki link to a page not written yet: dashed, an invitation to write it. */
.sbe-wikilink--new { color: var(--ads-ink-muted); text-decoration-style: dashed; }
/* Markdown in a fixed-width font, so its marks line up; its preview framed as the page
   will be. */
.sbe-source { font-family: var(--ads-font-mono); font-size: var(--ads-text-sm); }
pre.sbe-source { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
/* The same in a page: the Markdown renderer marks such a link `wikilink new`. */
.ads-prose a.wikilink.new { color: var(--ads-ink-muted); text-decoration-style: dashed; }
.sbe-preview-pane {
  height: 100%;
  padding: var(--ads-space-3) var(--ads-space-4);
  border: var(--ads-border-width) dashed var(--ads-line);
  border-radius: var(--ads-radius);
}
/* Two revisions compared, line by line: a line gone on red, a new one on green, each
   with its sign for those who do not see the colours. */
.sbe-diff { margin: 0; padding: 0; list-style: none; font-family: var(--ads-font-mono); font-size: var(--ads-text-sm); }
.sbe-diff__line { display: flex; gap: var(--ads-space-2); min-height: 1.5em; padding: 0 var(--ads-space-2); }
.sbe-diff__line > code { padding: 0; background: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.sbe-diff__op { flex: none; width: 1ch; font-weight: var(--ads-weight-bold); }
.sbe-diff__line--add > .sbe-diff__op { color: var(--ads-success-ink); }
.sbe-diff__line--del > .sbe-diff__op { color: var(--ads-danger-ink); }
.sbe-diff__line--add, .sbe-diff__mark--add { background: var(--ads-success-tint); }
.sbe-diff__line--del, .sbe-diff__mark--del { background: var(--ads-danger-tint); }
.sbe-diff__mark { padding: 0 var(--ads-space-2); font-size: var(--ads-text-sm); border-radius: var(--ads-radius-sm); }

/* A month's heading in the list, as a rule across it. */
.sbe-month { margin-inline: var(--ads-space-4); font-weight: var(--ads-weight-medium); }
/* The month at a glance, in a column: the days, an event as a dot under its date. */
.sbe-calendar--mini .ads-calendar__day { align-items: center; min-height: 0; padding: var(--ads-space-1); }
.sbe-calendar--mini .ads-calendar__date { align-self: center; }
.sbe-calendar--mini .ads-calendar__event { width: .375rem; height: .375rem; padding: 0; background: var(--ads-tone-solid); border-radius: 50%; }
/* What, when, where: an icon before each fact. */
.sbe-facts { display: grid; grid-template-columns: auto 1fr; gap: var(--ads-space-2) var(--ads-space-3); align-items: center; margin: 0; }
.sbe-facts > dt { display: flex; color: var(--ads-ink-muted); }
.sbe-facts > dd { margin: 0; }

/* Settings as pairs, in a column: the name, small, over its value. */
.sbe-pairs { display: grid; gap: var(--ads-space-1); margin: 0; }
.sbe-pairs > dt { font-size: var(--ads-text-sm); color: var(--ads-ink-muted); }
.sbe-pairs > dd { margin: 0 0 var(--ads-space-2); }
.sbe-pairs > dd:last-child { margin-bottom: 0; }
/* A filter's menus beside its field: as wide as what they say. */
.sbe-toolbar > .ads-select { width: auto; }
/* A toolbar whose fields may go to the next line on a narrow screen; a field in it
   that takes what room there is. */
.sbe-toolbar--wrap { flex-wrap: wrap; }
.sbe-toolbar > .sbe-grow, .sbe-toolbar > .picker { flex: 1 1 15rem; min-width: 0; }
/* A field as wide as what it holds (a date), not as the line. */
.sbe-fit { flex: none; width: auto; }
/* A number's own width follows its `max`, and a field with none is as wide as a line. */
.sbe-fit[type="number"] { width: 6rem; }
/* A long value with no spaces (a path, a URI) breaks where it must, not out of its box. */
.sbe-wrap { overflow-wrap: anywhere; }
/* A person's name in a table keeps room for itself: on a phone the table scrolls
   rather than the name being cut to a letter. */
.sbe-cell-person { min-width: 10rem; }
/* A table's scroll container holds what is positioned inside it: a header's text said
   only to screen readers, absolutely positioned, escaped it and widened a phone's page
   (ADS request 28). */
.ads-table-scroll { position: relative; }
/* A step not reached yet, readable: at 40 % of the ink it fails the contrast (ADS
   request 29). */
.ads-step { color: var(--ads-ink-muted); }
/* A choice in a table's row, as tall as the row's buttons. */
.sbe-select--sm { width: auto; padding-block: var(--ads-space-1); font-size: var(--ads-text-sm); }
/* An icon in a line of text, the size of the text. */
.sbe-icon-text { width: 1em; height: 1em; }
/* A line of the log: what was done, as an icon in its tone. */
.sbe-audit-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--ads-control-md);
  height: var(--ads-control-md);
  color: var(--ads-tone);
  background: var(--ads-tone-tint);
  border-radius: var(--ads-radius);
}

/* What a change in the log changed: one line a field, the old value struck out. */
.sbe-changes { margin: 0; padding: 0; list-style: none; font-size: var(--ads-text-sm); }
.sbe-changes .sbe-changes { display: inline; }
.sbe-changes .sbe-changes > li { display: inline; }
.sbe-changes ins { text-decoration: none; color: var(--ads-ink); }

/* The dashboard's charts (uPlot draws them; its markup is fixed, hence its classes):
   the legend, which follows the cursor, in the type of the page; the switch between
   day, week and month at the end of the line. */
.chart { width: 100%; }
.chart .u-legend { margin-block-start: var(--ads-space-2); font-size: var(--ads-text-sm); color: var(--ads-ink); }
/* uPlot sets the marker's border inline, its middle transparent: half the box on each
   side makes it a solid swatch, and only `!important` beats an inline style. */
.chart .u-legend .u-marker { margin-inline-end: var(--ads-space-1); border-width: 0.5em !important; }
.chart .u-legend .u-series:first-child .u-marker { display: none; }
.chart .u-legend .u-series { cursor: pointer; }
.chart .u-legend .u-series.u-off { color: var(--ads-ink-muted); }
.chart .u-legend .u-value { font-weight: var(--ads-weight-medium); font-variant-numeric: tabular-nums; color: var(--ads-ink-strong); }
.chart .u-select { background: var(--ads-brand-wash); }
.chart-grains { display: flex; justify-content: flex-end; margin-block-end: var(--ads-space-2); }

/* A row's header reads as the row's first cell, not as a column's header (ADS request 30). */
.ads-table tbody th {
  --ads-row-pad: calc(var(--ads-space-3) * var(--ads-row-scale));
  padding-block: var(--ads-row-pad);
  color: var(--ads-ink);
  font-size: inherit;
  font-weight: var(--ads-weight-normal);
  text-transform: none;
  letter-spacing: normal;
  background: none;
  border-bottom: 0;
  border-top: var(--ads-border-width) solid var(--ads-line-soft);
}

/* A switch whose label wraps keeps its track whole: in a flex row it shrank to a sliver
   (ADS request 31). */
.ads-switch__track { flex: none; }

/* A photo in an avatar, an image in a community's tile: the whole round or square,
   cropped (ADS request 32 for the avatar). */
.ads-avatar > img, .sbe-tile > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* A list of several choices does not drop down: no chevron (ADS request 33). */
.ads-select[multiple] { background-image: none; padding-inline-end: var(--ads-space-4); }

/* The bar's search and its suggestions: the panel as wide as it needs, under the
   field; the current suggestion marked by its tint alone, no tick, since it is not a
   choice (ADS request 34); the keys at the foot. */
.sbe-suggest { flex: 0 1 26rem; min-width: 9rem; display: flex; }
.sbe-suggest > .sbe-search { flex: 1 1 auto; }
.sbe-search__key { flex: none; }
.sbe-suggest__panel { inset-inline: auto 0; width: min(34rem, 90vw); max-height: min(32rem, 70vh); }
.sbe-suggest__option { color: inherit; text-decoration: none; }
.sbe-suggest__option[aria-selected="true"]::after { content: none; }
.sbe-suggest__option[aria-selected="true"] { background: var(--ads-brand-wash); }
.sbe-suggest__option mark { background: none; color: inherit; font-weight: var(--ads-weight-bold); }
.sbe-suggest__elsewhere { margin-block-start: var(--ads-space-1); border-block-start: var(--ads-border-width) solid var(--ads-line-soft); border-radius: 0; }
.sbe-suggest__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ads-space-2); padding: var(--ads-space-2) var(--ads-space-3); margin-block-start: var(--ads-space-1); border-block-start: var(--ads-border-width) solid var(--ads-line-soft); font-size: var(--ads-text-sm); }
.sbe-suggest__keys .ads-kbd { padding: 0 var(--ads-space-1); }
/* On a phone the field hides behind the bar's magnifier; open, the search takes the
   bar's whole width, the suggestions the screen's under it. */
@media (max-width: 47.99em) {
  .sbe-suggest { display: none; }
  .sbe-suggest.is-open, .sbe-suggest:has(.sbe-suggest__panel) { display: flex; position: fixed; inset: 0 0 auto 0; z-index: 20; padding: var(--ads-space-2); background: var(--ads-surface); }
  .sbe-suggest.is-open > .sbe-search, .sbe-suggest:has(.sbe-suggest__panel) > .sbe-search { display: flex; flex: 1 1 auto; }
  .sbe-search__key { display: none; }
  .sbe-suggest__panel { position: fixed; inset: 3.5rem 0 0 0; width: auto; max-height: none; border-radius: 0; }
}

/* A step passed in a sequence: drawn as the current one, without its weight. ADS draws
   only `[aria-current]`, which is for the current step alone. ADS request 35. */
.ads-step.sbe-step--done { color: var(--ads-ink); }
.ads-step.sbe-step--done::before, .ads-step.sbe-step--done::after { background: var(--ads-brand); color: var(--ads-brand-fg); }
