/*
 * The staff UI system's stylesheet (published as `ui-v2`; docs/platform/UI-SYSTEM.md).
 *
 * Hand-written, no build step: every component of core/src/ui/v2/components.ts is one `ui-*` class here, drawn
 * from the tokens below. A firm's look is the tokens (set per tenant by core/src/ui/v2/tokens.ts in a nonce'd
 * <style>), never a change to this file.
 *
 * Layers: the same order as the Tailwind sheets (`dash-look`), so the two can load together in either order and
 * a utility class still wins over a component.
 */
@layer theme, base, kit, components, utilities;

/*
 * The faces: Inter for text, Lora for titles, Archivo for a heading without a face of its own, self-hosted
 * (packages/core/public/portal-font-*.woff2 and font-archivo-*.woff2, as legacy-fonts.css and fonts.css declare them;
 * assemble points each url() at its hashed copy). A staff page of the system loads this sheet alone, so it carries its
 * own faces and the resets below.
 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/css/portal-font-inter-latin-ext.a28eb6d3cc.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/css/portal-font-inter-latin.c940764593.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/css/portal-font-lora-latin-ext.55606fbc76.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/css/portal-font-lora-latin.6b102ab35a.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/css/font-archivo-vietnamese.e65711486b.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/css/font-archivo-latin-ext.a75c792f98.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/css/font-archivo-latin.4c98b9d490.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo Fallback"; src: local("Arial"); ascent-override: 88.96%; descent-override: 21.28%; line-gap-override: 0%; size-adjust: 98.7%; }

@layer theme {
  .ui {
    /* Colour: the firm's (tokens.ts overrides these). */
    --ui-brand: #1c4070;
    --ui-brand-hover: #16335a;
    --ui-brand-soft: #e8edf4;
    --ui-on-brand: #fff;
    --ui-ink: #14213a;
    --ui-body: #3d4a5f;
    --ui-muted: #647084;
    --ui-ground: #f7f6f3;
    --ui-surface: #fff;
    --ui-line: #e4e2dc;
    --ui-line-strong: #c9c6bd;
    /* Colour: meaning. The same for every firm. */
    --ui-urgent: #b42318;
    --ui-urgent-soft: #fef1ef;
    --ui-soon: #93500b;
    --ui-soon-soft: #fdf3e1;
    --ui-ok: #0b6b43;
    --ui-ok-soft: #e7f5ee;
    /* Shape and type. */
    --ui-radius: 16px;
    --ui-radius-sm: 10px;
    --ui-radius-pill: 999px;
    --ui-font: var(--font-portal-sans, "Inter"), ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --ui-font-title: var(--font-portal-serif, "Lora"), Georgia, serif;
    --ui-text: 16px;
    --ui-rail-w: 244px;
    /* The rail: light by default; tokens.ts paints it in the brand colour when the firm asks. */
    --ui-rail-bg: var(--ui-surface);
    --ui-rail-ink: var(--ui-body);
    --ui-rail-strong: var(--ui-ink);
    --ui-rail-muted: var(--ui-muted);
    --ui-rail-line: var(--ui-line);
    --ui-rail-hover: var(--ui-ground);
    --ui-rail-on: var(--ui-brand-soft);
    --ui-rail-on-ink: var(--ui-brand);
    --ui-shadow: 0 1px 2px rgb(20 33 58 / 0.05);
  }
}

@layer base {
  /*
   * The resets the system's pages need without the Tailwind sheet: its preflight and the dashboard's own base
   * (styles/dash.css), scoped to the frame, so a page looks the same with that sheet loaded (a legacy body) or not.
   */
  :root:has(> body.ui) {
    color-scheme: light;
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    -webkit-tap-highlight-color: transparent;
  }
  body.ui {
    margin: 0;
    background: var(--ui-ground);
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizelegibility;
    caret-color: var(--ui-brand);
  }
  .ui :where(*, ::before, ::after, ::backdrop),
  .ui ::file-selector-button {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
    border-color: var(--ui-line);
  }
  .ui :where(h1, h2, h3, h4, h5, h6) {
    font-size: inherit;
    font-weight: inherit;
  }
  /* Headings without a face of their own: Archivo, tight (dash.css). */
  .ui :where(h1, h2, h3, h4) {
    font-family: "Archivo", "Archivo Fallback", ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -0.03em;
    text-wrap: balance;
    line-height: 1.1;
  }
  .ui :where(ol, ul, menu) {
    list-style: none;
  }
  .ui :where(a) {
    color: inherit;
    text-decoration: inherit;
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
  }
  .ui :where(b, strong) {
    font-weight: bolder;
  }
  .ui :where(small) {
    font-size: 80%;
  }
  .ui :where(sub, sup) {
    position: relative;
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
  }
  .ui :where(sub) {
    bottom: -0.25em;
  }
  .ui :where(sup) {
    top: -0.5em;
  }
  .ui :where(code, kbd, samp, pre) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1em;
  }
  .ui :where(table) {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  .ui :where(hr) {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }
  .ui :where(summary) {
    display: list-item;
  }
  .ui :where(img, svg, video, canvas, audio, iframe, embed, object) {
    display: block;
    vertical-align: middle;
  }
  .ui :where(img, video) {
    max-width: 100%;
    height: auto;
  }
  .ui :where(button, input, select, optgroup, textarea),
  .ui ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: transparent;
    border-radius: 0;
  }
  .ui :where(textarea) {
    resize: vertical;
  }
  .ui ::placeholder {
    color: #8a91a0;
    opacity: 1;
  }
  .ui ::-webkit-search-decoration {
    -webkit-appearance: none;
  }
  .ui ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }
  .ui ::-webkit-datetime-edit {
    display: inline-flex;
    padding-block: 0;
  }
  .ui :where(button, input:where([type="button"], [type="reset"], [type="submit"])),
  .ui ::file-selector-button {
    appearance: button;
  }
  .ui ::-webkit-inner-spin-button,
  .ui ::-webkit-outer-spin-button {
    height: auto;
  }
  .ui ::selection {
    background: var(--ui-brand);
    color: #fff;
  }
  .ui :focus-visible {
    outline: 2px solid var(--ui-brand);
    outline-offset: 3px;
  }
  .ui :focus:not(:focus-visible) {
    outline: none;
  }
  .ui {
    font-family: var(--ui-font);
    font-size: var(--ui-text);
    line-height: 1.5;
    color: var(--ui-ink);
    -webkit-font-smoothing: antialiased;
  }
  .ui-shell *,
  .ui-shell *::before,
  .ui-shell *::after {
    box-sizing: border-box;
  }
  .ui-page :where(h1, h2, h3, p, ul, ol, dl, dd, figure) {
    margin: 0;
    padding: 0;
  }
  .ui-page :where(ul, ol) {
    list-style: none;
  }
  .ui-page :where(a) {
    color: inherit;
    text-decoration: none;
  }
  .ui-page :where(button, input, select, textarea) {
    font: inherit;
    color: inherit;
  }
  .ui [hidden] {
    display: none !important;
  }
}

@layer components {
  /* ---------- Frame ---------- */
  .ui-shell {
    min-height: 100dvh;
    background: var(--ui-surface);
  }
  .ui-rail {
    display: none;
  }
  .ui-main {
    outline: none;
    padding-bottom: 5.5rem;
  }
  .ui-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    height: 56px;
    align-items: center;
    padding: 0 16px;
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-line);
  }
  .ui-brandmark {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: var(--ui-rail-strong);
    text-decoration: none;
  }
  .ui-topbar .ui-brandmark {
    color: var(--ui-ink);
  }
  .ui-brandmark-tile {
    display: grid;
    width: 40px;
    height: 40px;
    flex: none;
    place-items: center;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--ui-line);
    font-family: var(--ui-font-title);
    font-weight: 600;
    color: var(--ui-brand);
  }
  .ui-brandmark-tile img {
    height: 24px;
    width: auto;
  }
  .ui-brandmark-name {
    display: block;
    font-family: var(--ui-font-title);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ui-brandmark-sub {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    color: var(--ui-rail-muted);
  }
  .ui-topbar .ui-brandmark-sub {
    color: var(--ui-muted);
  }
  .ui-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .ui-nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: var(--ui-radius-sm);
    font-size: 15px;
    font-weight: 500;
    color: var(--ui-rail-ink);
    text-decoration: none;
  }
  .ui-nav a:hover {
    background: var(--ui-rail-hover);
    color: var(--ui-rail-strong);
  }
  .ui-nav a[aria-current="page"] {
    background: var(--ui-rail-on);
    color: var(--ui-rail-on-ink);
    font-weight: 600;
  }
  .ui-nav svg {
    width: 20px;
    height: 20px;
    flex: none;
    opacity: 0.8;
  }
  .ui-nav a[aria-current="page"] svg {
    opacity: 1;
  }
  .ui-nav-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ui-nav-group {
    margin: 0 0 6px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ui-rail-muted);
  }
  .ui-badge {
    min-width: 24px;
    padding: 0 7px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-rail-hover);
    border: 1px solid var(--ui-rail-line);
    font-size: 12px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--ui-rail-strong);
  }
  .ui-who {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-rail-line);
  }
  .ui-who-name {
    display: block;
    min-width: 0;
    flex: 1;
    padding: 4px 8px;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-rail-strong);
    text-decoration: none;
  }
  .ui-who-name:hover {
    background: var(--ui-rail-hover);
  }
  .ui-who-name b {
    display: block;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ui-who-role {
    display: block;
    font-size: 13px;
    color: var(--ui-rail-muted);
  }
  .ui-who-initials {
    display: none;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-rail-hover);
    border: 1px solid var(--ui-rail-line);
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-rail-strong);
  }
  .ui-who button {
    display: inline-flex;
    height: 36px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--ui-radius-sm);
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-rail-muted);
    cursor: pointer;
  }
  .ui-who button:hover {
    background: var(--ui-rail-hover);
    color: var(--ui-rail-strong);
  }
  .ui-who svg {
    width: 16px;
    height: 16px;
  }
  .ui-tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--ui-surface);
    border-top: 1px solid var(--ui-line);
  }
  .ui-tabbar ul {
    display: flex;
    max-width: 36rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
  }
  .ui-tabbar li {
    min-width: 0;
    flex: 1;
  }
  .ui-tabbar a {
    position: relative;
    display: flex;
    height: 60px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-muted);
    text-decoration: none;
  }
  .ui-tabbar a[aria-current="page"] {
    color: var(--ui-brand);
  }
  .ui-tabbar svg {
    width: 22px;
    height: 22px;
  }
  .ui-tabbar .ui-badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 4px);
    min-width: 18px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 16px;
    background: var(--ui-ink);
    border-color: var(--ui-ink);
    color: #fff;
  }
  dialog.ui-more {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 12px;
    border: 0;
    background: transparent;
  }
  dialog.ui-more::backdrop {
    background: rgb(20 33 58 / 0.3);
  }
  .ui-more-panel {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 12px 12px 16px;
    border-radius: 24px;
    background: var(--ui-surface);
    --ui-rail-ink: var(--ui-body);
    --ui-rail-strong: var(--ui-ink);
    --ui-rail-muted: var(--ui-muted);
    --ui-rail-line: var(--ui-line);
    --ui-rail-hover: var(--ui-ground);
    --ui-rail-on: var(--ui-brand-soft);
    --ui-rail-on-ink: var(--ui-brand);
  }
  .ui-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-left: 8px;
  }
  .ui-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 16px;
    background: var(--ui-ink);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
  }
  .ui-strip a {
    padding: 2px 12px;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: var(--ui-radius-pill);
    color: #fff;
    white-space: nowrap;
    text-decoration: none;
  }
  @media (min-width: 64rem) {
    .ui-shell {
      padding-left: var(--ui-rail-w);
    }
    .ui-rail {
      position: fixed;
      inset: 0 auto 0 0;
      z-index: 40;
      display: flex;
      width: var(--ui-rail-w);
      flex-direction: column;
      overflow-y: auto;
      padding: 20px 14px;
      background: var(--ui-rail-bg);
      border-right: 1px solid var(--ui-rail-line);
    }
    .ui-rail-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin: 0 0 24px 4px;
    }
    .ui-rail-toggle {
      display: inline-grid;
      width: 36px;
      height: 36px;
      flex: none;
      place-items: center;
      border: 0;
      border-radius: var(--ui-radius-sm);
      background: none;
      color: var(--ui-rail-muted);
      cursor: pointer;
    }
    .ui-rail-toggle:hover {
      background: var(--ui-rail-hover);
      color: var(--ui-rail-strong);
    }
    .ui-rail-toggle svg {
      width: 20px;
      height: 20px;
    }
    .ui-rail-toggle svg + svg,
    .ui-shell[data-rail="compact"] .ui-rail-toggle svg:first-child {
      display: none;
    }
    .ui-shell[data-rail="compact"] .ui-rail-toggle svg + svg {
      display: block;
    }
    /* The rail narrow, icons only: this browser's choice (shell.ts RAIL_COOKIE). Every word stays for a screen reader. */
    .ui-shell[data-rail="compact"] {
      --ui-rail-w: 76px;
    }
    .ui-shell[data-rail="compact"] .ui-rail {
      padding: 20px 12px;
    }
    .ui-shell[data-rail="compact"] .ui-rail-head {
      flex-direction: column;
      margin: 0 0 20px;
    }
    .ui-shell[data-rail="compact"] .ui-brandmark > span + span,
    .ui-shell[data-rail="compact"] .ui-nav-label,
    .ui-shell[data-rail="compact"] .ui-nav-group,
    .ui-shell[data-rail="compact"] .ui-who-name b,
    .ui-shell[data-rail="compact"] .ui-who-role,
    .ui-shell[data-rail="compact"] .ui-who-out {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .ui-shell[data-rail="compact"] .ui-nav a {
      position: relative;
      justify-content: center;
      padding: 0;
    }
    .ui-shell[data-rail="compact"] .ui-nav .ui-badge {
      position: absolute;
      top: 2px;
      right: 2px;
      min-width: 18px;
      padding: 0 4px;
      font-size: 10px;
      line-height: 16px;
    }
    .ui-shell[data-rail="compact"] .ui-who {
      flex-direction: column;
    }
    .ui-shell[data-rail="compact"] .ui-who-name {
      flex: none;
      padding: 4px;
    }
    .ui-shell[data-rail="compact"] .ui-who-initials {
      display: grid;
    }
    .ui-shell[data-rail="compact"] .ui-who button {
      width: 36px;
      justify-content: center;
      padding: 0;
    }
    .ui-rail nav {
      display: flex;
      flex: 1;
      flex-direction: column;
    }
    .ui-rail-office {
      margin-top: auto;
      padding-top: 24px;
    }
    .ui-topbar,
    .ui-tabbar,
    dialog.ui-more {
      display: none;
    }
    .ui-main {
      padding-bottom: 0;
    }
  }

  .ui-showmore {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 16px;
  }

  /* ---------- Page ---------- */
  .ui-page {
    min-height: 100dvh;
    padding: 24px 16px 48px;
    background: var(--ui-ground);
  }
  .ui-page-in {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
  }
  .ui-page--narrow .ui-page-in {
    max-width: 44rem;
  }
  .ui-page--wide .ui-page-in {
    max-width: 72rem;
  }
  @media (min-width: 40rem) {
    .ui-page {
      padding: 40px 32px 64px;
    }
  }
  .ui-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 28px;
  }
  .ui-head-text {
    min-width: 0;
  }
  .ui-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-brand);
  }
  .ui-back:hover {
    text-decoration: underline;
  }
  .ui-back svg {
    width: 16px;
    height: 16px;
  }
  .ui-title {
    font-family: var(--ui-font-title);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ui-ink);
  }
  .ui-lede {
    margin-top: 8px;
    max-width: 40rem;
    font-size: 17px;
    color: var(--ui-body);
  }
  .ui-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  /* A record's facts under its title (ui.head `meta`): the file number, the service, chips. */
  .ui-head-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-top: 8px;
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-head-meta .ui-link {
    font-size: 14px;
  }

  /* ---------- Buttons ---------- */
  .ui-btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-surface);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ui-ink);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms;
  }
  .ui-btn:hover {
    border-color: var(--ui-ink);
  }
  .ui-btn:focus-visible,
  .ui-nav a:focus-visible,
  .ui-tabs a:focus-visible,
  .ui-seg a:focus-visible,
  .ui-linkcard:focus-visible,
  .ui-row-title a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ui-brand) 45%, transparent);
    outline-offset: 2px;
  }
  .ui-btn[disabled] {
    opacity: 0.55;
    pointer-events: none;
  }
  .ui-btn svg {
    width: 18px;
    height: 18px;
    flex: none;
  }
  .ui-btn--primary {
    border-color: var(--ui-brand);
    background: var(--ui-brand);
    color: var(--ui-on-brand);
  }
  .ui-btn--primary:hover {
    border-color: var(--ui-brand-hover);
    background: var(--ui-brand-hover);
  }
  .ui-btn--quiet {
    border-color: transparent;
    background: transparent;
    color: var(--ui-brand);
  }
  .ui-btn--quiet:hover {
    border-color: transparent;
    background: var(--ui-brand-soft);
  }
  .ui-btn--danger {
    border-color: color-mix(in srgb, var(--ui-urgent) 35%, transparent);
    color: var(--ui-urgent);
  }
  .ui-btn--danger:hover {
    border-color: var(--ui-urgent);
    background: var(--ui-urgent-soft);
  }
  /* A decision's "yes" (Accept): outlined in green, the same weight as danger's "no", never filled. */
  .ui-btn--ok {
    border-color: color-mix(in srgb, var(--ui-ok) 40%, transparent);
    color: var(--ui-ok);
  }
  .ui-btn--ok:hover {
    border-color: var(--ui-ok);
    background: var(--ui-ok-soft);
  }
  .ui-details--button > summary.ui-btn--danger {
    color: var(--ui-urgent);
  }
  .ui-details--button > summary.ui-btn--ok {
    color: var(--ui-ok);
  }
  .ui-btn--lg {
    min-height: 52px;
    padding: 0 24px;
    font-size: 17px;
  }
  .ui-btn--sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }
  .ui-btn--block {
    width: 100%;
  }
  /* An icon alone (a document to open): square, still 44px to press, with its words in aria-label. */
  .ui-btn--icon {
    width: 44px;
    min-width: 44px;
    padding: 0;
    gap: 0;
  }
  .ui-btn--icon.ui-btn--sm {
    width: 36px;
    min-width: 36px;
  }
  .ui-link {
    font-weight: 600;
    color: var(--ui-brand);
    text-decoration: none;
  }
  .ui-link:hover {
    text-decoration: underline;
  }
  .ui-link svg {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    flex: none;
    vertical-align: -3px;
  }

  /* ---------- Cards, sections ---------- */
  .ui-card {
    padding: 20px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
  }
  .ui-card--flush {
    padding: 0;
    overflow: hidden;
  }
  .ui-card--urgent {
    border-color: color-mix(in srgb, var(--ui-urgent) 30%, var(--ui-line));
  }
  @media (min-width: 40rem) {
    .ui-card {
      padding: 24px;
    }
    .ui-card--flush {
      padding: 0;
    }
  }
  .ui-section {
    margin-top: 32px;
  }
  .ui-section:first-child {
    margin-top: 0;
  }
  .ui-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 12px;
  }
  .ui-section-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ui-ink);
  }
  .ui-section-title a {
    color: inherit;
  }
  .ui-section-title a:hover {
    color: var(--ui-brand);
    text-decoration: underline;
  }
  .ui-count {
    margin-left: 8px;
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ui-muted);
  }
  .ui-section--fold > summary {
    min-height: 44px;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    list-style: none;
  }
  .ui-section--fold > summary::-webkit-details-marker {
    display: none;
  }
  .ui-section-fold {
    width: 9px;
    height: 9px;
    margin-left: 4px;
    border-right: 2px solid var(--ui-muted);
    border-bottom: 2px solid var(--ui-muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
  }
  .ui-section--fold[open] .ui-section-fold {
    transform: rotate(45deg);
  }
  .ui-section--fold:not([open]) > summary {
    margin-bottom: 0;
  }
  .ui-section-note {
    margin: -6px 0 12px;
    font-size: 15px;
    color: var(--ui-muted);
  }
  .ui-stack > * + * {
    margin-top: 16px;
  }
  .ui-stack--lg > * + * {
    margin-top: 24px;
  }
  .ui-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .ui-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }
  .ui-actions:has(.ui-details--button[open]) > form {
    display: none;
  }
  .ui-grid2 {
    display: grid;
    gap: 16px;
  }
  @media (min-width: 48rem) {
    .ui-grid2 {
      grid-template-columns: 1fr 1fr;
    }
  }
  .ui-muted {
    color: var(--ui-muted);
  }
  .ui-nowrap {
    white-space: nowrap;
  }
  .ui-small {
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .ui-bullets {
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-bullets-title {
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--ui-ink);
  }
  .ui-bullets ul {
    padding-left: 20px;
    list-style: disc;
  }
  .ui-bullets li + li {
    margin-top: 4px;
  }
  .ui-prose {
    font-size: 16px;
    color: var(--ui-body);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .ui-prose--lg {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ui-ink);
  }
  /* A record's head inside a pane (ui.recordHead). */
  .ui-rec-head {
    margin-bottom: 20px;
  }
  .ui-rec-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-family: var(--ui-font-title);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ui-ink);
    overflow-wrap: anywhere;
  }
  .ui-rec-meta {
    margin-top: 6px;
    font-size: 15px;
    color: var(--ui-muted);
  }
  .ui-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* ---------- Lists and rows ---------- */
  .ui-list > li + li {
    border-top: 1px solid var(--ui-line);
  }
  .ui-list-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 4px 20px;
    border-top: 1px solid var(--ui-line);
  }
  .ui-list-foot .ui-link,
  .ui-row-foot .ui-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
  .ui-row-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--ui-line);
  }
  .ui-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 14px 20px;
  }
  .ui-row-lead {
    flex: none;
  }
  .ui-row-main {
    min-width: 0;
    flex: 1 1 16rem;
  }
  .ui-row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ui-ink);
  }
  .ui-row-title a:hover {
    color: var(--ui-brand);
    text-decoration: underline;
  }
  .ui-row-meta {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: var(--ui-muted);
    overflow-wrap: anywhere;
  }
  .ui-row-note {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-row-note--urgent {
    font-weight: 600;
    color: var(--ui-urgent);
  }
  .ui-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .ui-row-extra {
    margin-top: 10px;
  }
  .ui-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--ui-line-strong);
    transform: translateY(-1px);
  }
  .ui-dot--urgent {
    background: var(--ui-urgent);
  }
  .ui-dot--soon {
    background: #d98a1c;
  }
  .ui-dot--ok {
    background: var(--ui-ok);
  }
  .ui-chip {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    gap: 4px;
    padding: 0 9px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-ground);
    border: 1px solid var(--ui-line);
    font-family: var(--ui-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ui-body);
    white-space: nowrap;
  }
  .ui-chip--urgent {
    background: var(--ui-urgent-soft);
    border-color: transparent;
    color: var(--ui-urgent);
  }
  .ui-chip--soon {
    background: var(--ui-soon-soft);
    border-color: transparent;
    color: var(--ui-soon);
  }
  .ui-chip--ok {
    background: var(--ui-ok-soft);
    border-color: transparent;
    color: var(--ui-ok);
  }
  .ui-chip--info {
    background: var(--ui-brand-soft);
    border-color: transparent;
    color: var(--ui-brand);
  }
  .ui-avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: none;
    place-items: center;
    border-radius: 50%;
    background: var(--ui-brand-soft);
    font-size: 15px;
    font-weight: 700;
    color: var(--ui-brand);
  }
  .ui-empty {
    padding: 40px 24px;
    border: 1px dashed var(--ui-line-strong);
    border-radius: var(--ui-radius);
    text-align: center;
  }
  .ui-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ui-ink);
  }
  .ui-empty-text {
    max-width: 28rem;
    margin: 6px auto 0;
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-empty-action {
    margin-top: 16px;
  }
  .ui-empty svg {
    width: 28px;
    height: 28px;
    margin: 0 auto 10px;
    color: var(--ui-ok);
  }

  .ui-dot--info {
    background: var(--ui-brand);
  }

  /* ---------- A list beside the record chosen from it (ui.split, ui.pickList) ---------- */
  .ui-split-back {
    margin-bottom: 16px;
  }
  @media (max-width: 55.99rem) {
    .ui-split--list .ui-split-main,
    .ui-split--main .ui-split-list {
      display: none;
    }
  }
  @media (min-width: 56rem) {
    .ui-split {
      display: grid;
      grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
      align-items: start;
      gap: 32px;
    }
    .ui-split-back {
      display: none;
    }
    /* The chosen record stays in view while the list is scrolled. */
    .ui-split-main {
      position: sticky;
      top: 24px;
      max-height: calc(100dvh - 48px);
      overflow-y: auto;
      border-radius: var(--ui-radius);
    }
  }
  /* In a list's column the search shares its line with its button. */
  .ui-split-list .ui-search {
    flex-basis: 0;
    max-width: none;
  }
  .ui-split-list .ui-toolbar,
  .ui-split-list .ui-head,
  .ui-split-list .ui-banner {
    margin-bottom: 0;
  }
  .ui-split-main > .ui-banner {
    margin-bottom: 16px;
  }
  .ui-pick > li + li {
    margin-top: 8px;
  }
  .ui-pick-item {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    color: var(--ui-ink);
    text-decoration: none;
  }
  .ui-pick-item:hover {
    border-color: var(--ui-line-strong);
  }
  .ui-pick-item[aria-current="true"] {
    border-color: var(--ui-brand);
    box-shadow: inset 0 0 0 1px var(--ui-brand);
  }
  .ui-pick-item:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ui-brand) 45%, transparent);
    outline-offset: 2px;
  }
  .ui-pick-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .ui-pick-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  .ui-pick-aside {
    flex: none;
    font-size: 14px;
    color: var(--ui-muted);
    white-space: nowrap;
  }
  .ui-pick-meta {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-size: 15px;
    color: var(--ui-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* ---------- A small menu (ui.menu): a native <details> that drops down ---------- */
  .ui-menu {
    position: relative;
    display: inline-block;
  }
  .ui-menu > summary {
    list-style: none;
  }
  .ui-menu > summary::-webkit-details-marker {
    display: none;
  }
  .ui-menu > summary svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
  }
  .ui-menu[open] > summary svg {
    transform: rotate(180deg);
  }
  .ui-menu > summary[aria-current="true"] {
    background: var(--ui-brand-soft);
  }
  .ui-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 13rem;
    padding: 6px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    box-shadow: 0 16px 40px -16px rgb(20 33 58 / 0.35);
  }
  .ui-menu--end .ui-menu-panel {
    right: 0;
    left: auto;
  }
  .ui-menu-title {
    padding: 8px 12px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
  }
  .ui-menu-panel form {
    margin: 0;
  }
  .ui-menu-panel a,
  .ui-menu-panel button {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--ui-ink);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  .ui-menu-panel a:hover,
  .ui-menu-panel button:hover {
    background: var(--ui-ground);
  }
  .ui-menu-panel a[aria-current="true"] {
    font-weight: 700;
    color: var(--ui-brand);
  }
  .ui-menu-panel .ui-count {
    margin-left: 0;
  }

  /* ---------- Tabs, toggles, toolbars ---------- */
  .ui-tabs {
    margin: 0 -16px 20px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ui-tabs ul {
    display: flex;
    min-width: max-content;
    gap: 4px;
    border-bottom: 1px solid var(--ui-line);
  }
  .ui-tabs a {
    position: relative;
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ui-muted);
  }
  .ui-tabs a:hover {
    color: var(--ui-ink);
  }
  .ui-tabs a[aria-current="page"] {
    color: var(--ui-ink);
  }
  .ui-tabs a[aria-current="page"]::after {
    content: "";
    position: absolute;
    inset: auto 8px -1px 8px;
    height: 3px;
    border-radius: 3px;
    background: var(--ui-brand);
  }
  .ui-tabs .ui-count {
    margin-left: 0;
    font-size: 14px;
  }
  .ui-seg {
    display: inline-flex;
    flex-wrap: wrap;
    padding: 3px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-surface);
  }
  .ui-seg a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    border-radius: var(--ui-radius-pill);
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-body);
  }
  .ui-seg a[aria-current="true"] {
    background: var(--ui-ink);
    color: #fff;
  }
  .ui-seg--forms {
    flex-wrap: wrap;
    padding: 3px;
  }
  .ui-seg--forms form {
    display: contents;
  }
  .ui-seg--forms button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--ui-radius-pill);
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-body);
    cursor: pointer;
  }
  .ui-seg--forms button:hover {
    color: var(--ui-ink);
  }
  .ui-seg--forms button[aria-pressed="true"] {
    background: var(--ui-ink);
    color: #fff;
  }
  .ui-seg--forms button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ui-brand) 45%, transparent);
    outline-offset: 2px;
  }
  .ui-seg .ui-count {
    margin-left: 0;
    font-size: 14px;
  }
  .ui-seg a[aria-current="true"] .ui-count {
    color: inherit;
    opacity: 0.8;
  }
  .ui-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .ui-toolbar-end {
    margin-left: auto;
  }
  .ui-search {
    position: relative;
    min-width: 0;
    flex: 1 1 16rem;
    max-width: 26rem;
  }
  .ui-search svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--ui-muted);
    transform: translateY(-50%);
    pointer-events: none;
  }
  .ui-search .ui-input {
    padding-left: 42px;
    border-radius: var(--ui-radius-pill);
  }

  /* ---------- Stepper (a file's course: the case file's header, and compact in a list's rows) ---------- */
  .ui-stepper {
    --mark: 40px;
    --step-min: 88px;
    --run: 4px;
    container-type: inline-size;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ui-stepper::-webkit-scrollbar {
    display: none;
  }
  .ui-stepper--sm {
    --mark: 24px;
    --step-min: 66px;
    --run: 3px;
    max-width: 52rem;
  }
  .ui-stepper ol {
    display: grid;
    grid-auto-columns: minmax(var(--step-min), 1fr);
    grid-auto-flow: column;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .ui-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 3px;
    text-align: center;
  }
  /* The line into each stop from the one before: solid where the file has been, dashed ahead. */
  .ui-step + .ui-step::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: calc(var(--mark) / 2 - 1px);
    right: 50%;
    width: 100%;
    border-top: 2px dashed color-mix(in srgb, var(--ui-brand) 35%, transparent);
  }
  .ui-step--done + .ui-step::before,
  .ui-step--done + .ui-step--far::before {
    top: calc(var(--mark) / 2 - var(--run) / 2);
    border-top: var(--run) solid var(--ui-brand);
  }
  .ui-step-mark {
    position: relative;
    z-index: 1;
    display: grid;
    width: var(--mark);
    height: var(--mark);
    flex: none;
    place-items: center;
    border: 2px solid color-mix(in srgb, var(--ui-brand) 40%, transparent);
    border-radius: 50%;
    background: var(--ui-surface);
    font-family: var(--ui-font-title);
    font-size: calc(var(--mark) * 0.45);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--ui-muted);
  }
  .ui-step--done .ui-step-mark {
    border-color: var(--ui-brand);
    background: var(--ui-brand);
    color: var(--ui-on-brand);
  }
  .ui-step--done .ui-step-mark > svg:not(.ui-step-tri) {
    width: calc(var(--mark) * 0.55);
    height: calc(var(--mark) * 0.55);
  }
  .ui-step--now .ui-step-mark {
    border: calc(var(--mark) / 10) solid var(--ui-brand);
    color: var(--ui-brand);
  }
  /* The start: a triangle; the end: a double ring. */
  .ui-step--start .ui-step-mark {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .ui-step-tri {
    width: 100%;
    height: 100%;
    overflow: visible;
  }
  .ui-step-tri polygon {
    fill: var(--ui-surface);
    stroke: var(--ui-brand);
    stroke-width: 3;
  }
  .ui-step--now .ui-step-tri polygon {
    stroke-width: 4;
  }
  .ui-step--done .ui-step-tri polygon {
    fill: var(--ui-brand);
  }
  .ui-step-tri path {
    stroke: var(--ui-on-brand);
    stroke-width: 3;
  }
  .ui-step--end .ui-step-mark {
    border-width: calc(var(--mark) / 13 + 1px);
  }
  .ui-step-ring {
    width: 50%;
    height: 50%;
    border: calc(var(--mark) / 13 + 1px) solid color-mix(in srgb, var(--ui-brand) 40%, transparent);
    border-radius: 50%;
  }
  .ui-step--now .ui-step-ring {
    border-color: var(--ui-brand);
  }
  .ui-step--done.ui-step--end .ui-step-mark {
    background: var(--ui-surface);
  }
  .ui-step--done .ui-step-ring {
    border-color: var(--ui-brand);
    background: var(--ui-brand);
  }
  .ui-step-label {
    display: -webkit-box;
    max-width: 9.5rem;
    margin-top: 8px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.3;
    color: var(--ui-muted);
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .ui-step--done .ui-step-label {
    font-weight: 500;
    color: var(--ui-body);
  }
  .ui-step--now .ui-step-label {
    font-weight: 700;
    color: var(--ui-ink);
  }
  .ui-step-now {
    display: inline-flex;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-brand);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ui-on-brand);
  }
  .ui-stepper--sm .ui-step-label {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.25;
  }
  .ui-stepper--sm .ui-step--now .ui-step-label {
    color: var(--ui-brand);
  }
  .ui-stepper--sm .ui-step-now {
    margin-top: 3px;
    padding: 0 6px;
    font-size: 11px;
  }
  .ui-stepper--sm .ui-step-tri polygon {
    stroke-width: 3.5;
  }
  /* A record's course in one card (ui.course): the stepper, the next step, the moves. */
  .ui-course {
    margin-bottom: 24px;
    padding: 24px 16px 12px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
  }
  .ui-course-next {
    margin: 20px -16px 0;
    padding: 0 0 4px;
    border-top: 1px solid var(--ui-line);
  }
  .ui-course-next > p {
    padding: 16px;
    font-size: 15px;
  }
  .ui-course-moves {
    display: flex;
    justify-content: flex-end;
    margin: 0 -4px;
    padding: 8px 0 4px;
  }
  @media (min-width: 40rem) {
    .ui-course {
      padding: 28px 24px 16px;
    }
    .ui-course-next {
      margin: 24px -24px 0;
    }
    .ui-course-next > p {
      padding: 16px 24px;
    }
    .ui-course-next > .ui-row {
      padding-inline: 24px;
    }
  }
  /* A stop that opens a sheet (the file's own course): the whole stop is the button. */
  .ui-step-btn {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 44px;
    flex-direction: column;
    align-items: center;
    padding: 0 4px 4px;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
  }
  .ui-step-btn:hover .ui-step-mark:not(:has(.ui-step-tri)) {
    border-color: var(--ui-brand);
  }
  .ui-step--later .ui-step-btn:hover .ui-step-mark,
  .ui-step--now .ui-step-btn:hover .ui-step-mark {
    background: var(--ui-brand-soft);
    color: var(--ui-brand);
  }
  .ui-step-btn:hover .ui-step-label {
    color: var(--ui-ink);
  }
  .ui-step-btn:focus-visible {
    outline: 2px solid var(--ui-brand);
    outline-offset: 2px;
  }
  /* A narrow row: the stops around the current one, with the first and the last. */
  @container (max-width: 520px) {
    .ui-step--far {
      display: none;
    }
    .ui-stepper ol {
      grid-auto-columns: minmax(0, 1fr);
    }
    /* Too narrow for every name: the marks say where the file is, the current stop says what it is called. The
       other names stay for a screen reader. */
    .ui-step:not(.ui-step--now) .ui-step-label {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .ui-step--now .ui-step-label {
      display: block;
      max-width: none;
      white-space: nowrap;
    }
    .ui-step--now:first-child {
      align-items: flex-start;
    }
    .ui-step--now:last-child {
      align-items: flex-end;
    }
  }

  /* ---------- Filter (rare choices behind one button) ---------- */
  .ui-filter {
    position: relative;
  }
  .ui-filter > summary {
    list-style: none;
    cursor: pointer;
  }
  .ui-filter > summary::-webkit-details-marker {
    display: none;
  }
  .ui-filter[open] > summary,
  .ui-filter-on {
    border-color: var(--ui-ink);
  }
  /* The Filter button's own count (not the rail's .ui-badge, which stays neutral). */
  .ui-filter-count {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-ink);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
  }
  .ui-filter-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    gap: 18px;
    width: min(32rem, calc(100vw - 32px));
    padding: 18px 20px 20px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: 0 2px 4px rgb(20 33 58 / 0.06), 0 18px 40px -18px rgb(20 33 58 / 0.35);
  }
  /* A phone: the panel opens in the page under the button, the full width, instead of floating. */
  @media (max-width: 39.99rem) {
    .ui-filter[open] {
      flex-basis: 100%;
    }
    .ui-filter-panel {
      position: static;
      width: auto;
      margin-top: 10px;
      box-shadow: none;
    }
  }
  .ui-filter-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ui-muted);
  }
  .ui-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .ui-filter-options a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-pill);
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-body);
  }
  .ui-filter-options a:hover {
    border-color: var(--ui-line-strong);
    color: var(--ui-ink);
  }
  .ui-filter-options a[aria-current="true"] {
    border-color: var(--ui-ink);
    background: var(--ui-ink);
    color: #fff;
  }
  .ui-filter-options a[aria-current="true"] .ui-count {
    color: inherit;
    opacity: 0.8;
  }
  .ui-filter-options svg {
    width: 16px;
    height: 16px;
  }
  .ui-filter-group .ui-cluster {
    gap: 8px;
  }
  .ui-chip--on {
    min-height: 32px;
    gap: 6px;
    padding: 0 8px 0 12px;
    background: var(--ui-surface);
    border-color: var(--ui-line-strong);
    font-size: 14px;
    color: var(--ui-ink);
  }
  .ui-chip--on svg {
    width: 15px;
    height: 15px;
    color: var(--ui-muted);
  }
  .ui-chip--on:hover svg {
    color: var(--ui-ink);
  }

  /* ---------- A quiet question ("Biometrics Nov 27 — done?") ---------- */
  .ui-ask {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    font-size: 14px;
    color: var(--ui-muted);
  }
  .ui-ask > svg {
    width: 16px;
    height: 16px;
    flex: none;
  }
  .ui-ask form {
    display: contents;
  }
  .ui-ask-btn,
  .ui-ask-link {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-body);
    cursor: pointer;
  }
  .ui-ask-link {
    border-color: transparent;
    background: transparent;
    color: var(--ui-muted);
  }
  .ui-ask-btn:hover,
  .ui-ask-link:hover {
    border-color: var(--ui-line-strong);
    color: var(--ui-ink);
  }
  .ui-row-extra > * + * {
    margin-top: 10px;
  }

  /* ---------- Forms ---------- */
  .ui-inline-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .ui-inline-field > .ui-label {
    margin: 0;
    font-size: 14px;
    color: var(--ui-muted);
    white-space: nowrap;
  }
  .ui-inline-field output {
    font-size: 15px;
    font-weight: 600;
  }
  .ui-field + .ui-field {
    margin-top: 16px;
  }
  .ui-label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-ink);
  }
  .ui-hint {
    margin-top: 6px;
    font-size: 14px;
    color: var(--ui-muted);
  }
  .ui-input,
  .ui-select,
  .ui-textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    font-family: inherit;
    font-size: 16px;
    color: var(--ui-ink);
  }
  .ui-textarea {
    min-height: 96px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
  }
  .ui-select {
    padding-right: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23647084' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
  }
  .ui-select--pill {
    width: auto;
    max-width: 100%;
    min-height: 44px;
    border-radius: var(--ui-radius-pill);
    font-size: 15px;
    font-weight: 600;
  }
  .ui-input:focus,
  .ui-select:focus,
  .ui-textarea:focus {
    border-color: var(--ui-brand);
    outline: 3px solid color-mix(in srgb, var(--ui-brand) 20%, transparent);
  }
  .ui-choice {
    display: flex;
    min-height: 44px;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-choice input {
    width: 18px;
    height: 18px;
    flex: none;
    margin: 2px 0 0;
    accent-color: var(--ui-brand);
  }
  .ui-choice b {
    color: var(--ui-ink);
  }
  .ui-fieldset {
    margin: 16px 0 0;
    padding: 0;
    border: 0;
  }
  .ui-fieldset legend {
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-ink);
  }
  .ui-error {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-urgent-soft);
    font-size: 15px;
    color: var(--ui-urgent);
  }
  .ui-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-banner--urgent {
    border-color: transparent;
    background: var(--ui-urgent-soft);
    color: var(--ui-urgent);
  }
  .ui-details > summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-brand);
    cursor: pointer;
    list-style: none;
  }
  .ui-details > summary::-webkit-details-marker {
    display: none;
  }
  .ui-details > summary::before {
    content: "+";
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--ui-line-strong);
    border-radius: 50%;
    font-weight: 500;
    line-height: 1;
  }
  .ui-details[open] > summary::before {
    content: "–";
  }
  .ui-details-body {
    padding-top: 12px;
  }
  /* A row that opens in place (rowDetails): the summary is the row itself, the panel under it in the card. */
  .ui-details--row > summary.ui-row {
    min-height: 0;
    padding: 14px 20px;
    gap: 10px 16px;
    font-size: var(--ui-text);
    font-weight: 400;
    color: var(--ui-ink);
    list-style: none;
  }
  .ui-details--row > summary.ui-row::-webkit-details-marker {
    display: none;
  }
  .ui-details--row > summary.ui-row::before {
    content: none;
  }
  .ui-details--row[open] > summary.ui-row {
    padding-bottom: 8px;
  }
  .ui-row-body {
    padding: 8px 20px 18px;
  }
  /* The row's button names what a press does: its label closed, "Close" open. */
  .ui-details--row .ui-when-open,
  .ui-details--row[open] > summary .ui-when-closed,
  .ui-details--button .ui-when-open,
  .ui-details--button[open] > summary .ui-when-closed {
    display: none;
  }
  .ui-details--row[open] > summary .ui-when-open,
  .ui-details--button[open] > summary .ui-when-open {
    display: inline;
  }
  /* An open row stands apart from the closed ones around it: the ground behind it, the brand at its edge. */
  .ui-details--row[open] {
    background: color-mix(in srgb, var(--ui-brand-soft) 45%, var(--ui-surface));
    box-shadow: inset 3px 0 0 var(--ui-brand);
  }

  /* ---------- A main part and a narrow side (a document and its decisions) ---------- */
  .ui-withside {
    display: grid;
    gap: 16px;
  }
  .ui-withside-main,
  .ui-withside-side {
    min-width: 0;
  }
  @media (min-width: 60rem) {
    .ui-withside {
      grid-template-columns: minmax(0, 1fr) 19rem;
      gap: 24px;
      align-items: start;
    }
  }
  @media (min-width: 72rem) {
    .ui-withside--wide {
      grid-template-columns: minmax(0, 1fr) 23rem;
      gap: 32px;
    }
  }

  /* The side's actions stack, full width: big targets beside the document. */
  .ui-withside-side .ui-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ui-withside-side .ui-actions > form,
  .ui-withside-side .ui-details--button > summary.ui-btn {
    display: flex;
    width: 100%;
  }
  .ui-withside-side .ui-actions > form .ui-btn {
    flex: 1;
  }

  /* ---------- A stored file, shown big ---------- */
  .ui-preview {
    margin: 0;
  }
  .ui-preview-frame {
    display: grid;
    min-height: 220px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-ground);
  }
  .ui-preview--pdf .ui-preview-frame {
    height: min(70vh, 760px);
  }
  .ui-preview-media {
    display: block;
    width: 100%;
    border: 0;
  }
  img.ui-preview-media {
    width: auto;
    max-width: 100%;
    max-height: min(70vh, 760px);
    object-fit: contain;
  }
  iframe.ui-preview-media {
    height: 100%;
    background: var(--ui-surface);
  }
  .ui-preview-empty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--ui-brand);
  }
  .ui-preview-empty svg,
  .ui-preview-caption svg {
    width: 16px;
    height: 16px;
  }
  .ui-preview-caption {
    margin-top: 8px;
    font-size: 14px;
  }
  .ui-preview-caption .ui-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  @media (max-width: 39.99rem) {
    .ui-preview--pdf .ui-preview-frame {
      height: 60vh;
    }
    img.ui-preview-media {
      max-height: 60vh;
    }
  }

  /* ---------- Chips that toggle (a few reasons) ---------- */
  .ui-chipset {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .ui-chipset .ui-label {
    margin-bottom: 8px;
    padding: 0;
  }
  .ui-chipset-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .ui-chipcheck {
    position: relative;
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--ui-line-strong);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-body);
    cursor: pointer;
  }
  .ui-chipcheck input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .ui-chipcheck:hover {
    border-color: var(--ui-ink);
    color: var(--ui-ink);
  }
  .ui-chipcheck:has(input:checked) {
    border-color: var(--ui-ink);
    background: var(--ui-ink);
    color: #fff;
  }
  .ui-chipcheck:has(input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--ui-brand) 45%, transparent);
    outline-offset: 2px;
  }

  /* A disclosure opened by a summary drawn as the kit's button: a row's second action, fields under it. */
  .ui-details--button > summary.ui-btn {
    display: inline-flex;
    color: var(--ui-ink);
    list-style: none;
  }
  .ui-details--button > summary.ui-btn::-webkit-details-marker {
    display: none;
  }
  .ui-details--button > summary.ui-btn::before {
    content: none;
  }
  .ui-details--button[open] {
    flex: 1 1 100%;
  }

  /* ---------- Sheets (native <dialog>, opened by core-app's data-drawer) ---------- */
  dialog.ui-sheet {
    width: min(34rem, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    overflow-y: auto;
    border: 0;
    border-radius: 20px;
    background: var(--ui-surface);
    color: var(--ui-ink);
    box-shadow: 0 30px 80px -20px rgb(20 33 58 / 0.45);
  }
  dialog.ui-sheet::backdrop {
    background: rgb(20 33 58 / 0.4);
  }
  dialog.ui-sheet--wide {
    width: min(44rem, calc(100vw - 24px));
  }
  /* Drawn open by its own address (no script): placed as the modal one is, over a scrim that leads back. */
  dialog.ui-sheet--open {
    position: fixed;
    inset: 0;
    z-index: 61;
  }
  .ui-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgb(20 33 58 / 0.4);
  }
  .ui-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 4px;
  }
  .ui-sheet-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }
  .ui-sheet-lede {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--ui-body);
  }
  .ui-sheet-close {
    display: grid;
    width: 40px;
    height: 40px;
    flex: none;
    place-items: center;
    margin: -6px -8px 0 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ui-muted);
    cursor: pointer;
  }
  .ui-sheet-close:hover {
    background: var(--ui-ground);
    color: var(--ui-ink);
  }
  .ui-sheet-close svg {
    width: 20px;
    height: 20px;
  }
  .ui-sheet-body {
    padding: 16px 24px;
  }
  .ui-sheet-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--ui-line);
    background: var(--ui-surface);
  }
  @media (min-width: 40rem) {
    .ui-sheet-foot {
      flex-direction: row;
      justify-content: flex-end;
    }
  }
  .ui-sheet-section {
    padding: 16px 24px;
    border-top: 1px solid var(--ui-line);
  }
  .ui-sheet-section h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
  }

  /* ---------- Tables, progress, marks, repeating field rows ---------- */
  .ui-table-wrap {
    overflow-x: auto;
  }
  .ui-table {
    width: 100%;
    min-width: 30rem;
    font-size: 15px;
  }
  .ui-table th,
  .ui-table td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--ui-line);
    text-align: left;
    vertical-align: top;
  }
  .ui-table th {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-muted);
  }
  .ui-table td {
    color: var(--ui-body);
  }
  .ui-table tfoot td {
    border-bottom: 0;
    font-weight: 600;
    color: var(--ui-ink);
  }
  .ui-table .ui-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .ui-progress {
    display: block;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border: 0;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-ground);
    appearance: none;
  }
  .ui-progress::-webkit-progress-bar {
    border-radius: var(--ui-radius-pill);
    background: var(--ui-ground);
  }
  .ui-progress::-webkit-progress-value {
    border-radius: var(--ui-radius-pill);
    background: var(--ui-brand);
  }
  .ui-progress::-moz-progress-bar {
    border-radius: var(--ui-radius-pill);
    background: var(--ui-brand);
  }
  .ui-checkmark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid var(--ui-line-strong);
    border-radius: 50%;
    background: var(--ui-surface);
  }
  .ui-checkmark--done {
    border-color: transparent;
    background: var(--ui-ok-soft);
    color: var(--ui-ok);
  }
  .ui-checkmark svg {
    width: 18px;
    height: 18px;
  }
  .ui-fieldrows {
    display: grid;
    gap: 10px;
  }
  .ui-fieldrows > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8rem 2.75rem;
    gap: 8px;
    align-items: center;
  }
  .ui-fieldrows > li[hidden] {
    display: none;
  }
  .ui-fieldrows > li > div:nth-child(3) {
    order: 4;
    grid-column: 1 / 3;
  }
  .ui-fieldrows-head {
    display: none;
  }
  @media (min-width: 40rem) {
    .ui-fieldrows > li,
    .ui-fieldrows-head {
      grid-template-columns: minmax(0, 1fr) 8rem 10.5rem 2.75rem;
    }
    .ui-fieldrows > li > div:nth-child(3) {
      order: 0;
      grid-column: auto;
    }
    .ui-fieldrows-head {
      display: grid;
      gap: 8px;
      margin-bottom: 4px;
      font-size: 13px;
      font-weight: 600;
      color: var(--ui-muted);
    }
  }

  /* ---------- Tiles and link cards ---------- */
  .ui-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  @media (min-width: 48rem) {
    .ui-tiles {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
  /* Figures inside a card (ui.tiles size "sm"): as many as fit, smaller. */
  .ui-tiles--sm {
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  }
  .ui-tiles--sm .ui-tile-value {
    font-size: 20px;
    overflow-wrap: anywhere;
  }
  .ui-tile {
    display: block;
    padding: 16px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
  }
  a.ui-tile:hover {
    border-color: var(--ui-line-strong);
  }
  .ui-tile-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--ui-ink);
  }
  .ui-tile-label {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--ui-body);
  }
  .ui-links {
    display: grid;
    gap: 12px;
  }
  @media (min-width: 40rem) {
    .ui-links {
      grid-template-columns: 1fr 1fr;
    }
  }
  .ui-linkcard {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
  }
  .ui-linkcard:hover {
    border-color: var(--ui-brand);
  }
  .ui-linkcard-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: none;
    place-items: center;
    border-radius: 12px;
    background: var(--ui-brand-soft);
    color: var(--ui-brand);
  }
  .ui-linkcard-icon svg {
    width: 22px;
    height: 22px;
  }
  .ui-linkcard-text {
    min-width: 0;
    flex: 1;
  }
  .ui-linkcard-title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--ui-ink);
  }
  .ui-linkcard-sub {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: var(--ui-muted);
  }
  .ui-linkcard > svg {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--ui-muted);
  }
  .ui-kv {
    display: grid;
    grid-template-columns: minmax(6rem, auto) 1fr;
    gap: 8px 16px;
    font-size: 15px;
  }
  .ui-kv--lg {
    gap: 12px 20px;
    font-size: 17px;
  }
  .ui-kv dt {
    color: var(--ui-muted);
  }
  .ui-kv dd {
    color: var(--ui-ink);
    overflow-wrap: anywhere;
  }

  /* ---------- Toast ---------- */
  .ui-toast {
    position: fixed;
    inset: auto 0 84px 0;
    z-index: 70;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
    animation: ui-toast-in 300ms ease-out both, ui-toast-out 260ms ease-in 5s forwards;
  }
  .ui-toast > div {
    display: flex;
    max-width: 28rem;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--ui-ink);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 20px 50px -20px rgb(20 33 58 / 0.6);
  }
  .ui-toast svg {
    width: 20px;
    height: 20px;
    flex: none;
    color: #5fd6a0;
  }
  /* A line with its action (an Undo), brought to the foot of the screen after a change made in place (app.js). */
  .ui-toast--action {
    animation: ui-toast-in 300ms ease-out both, ui-toast-out 260ms ease-in 10s forwards;
  }
  .ui-toast--action > div {
    pointer-events: auto;
    font-weight: 500;
  }
  .ui-toast--action form {
    margin: 0;
  }
  .ui-toast--action .ui-btn {
    min-height: 36px;
    border-color: transparent;
    background: #fff;
    color: var(--ui-ink);
  }
  @media (min-width: 64rem) {
    .ui-toast {
      bottom: 24px;
      padding-left: var(--ui-rail-w);
    }
  }
  @keyframes ui-toast-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
  @keyframes ui-toast-out {
    to {
      opacity: 0;
      visibility: hidden;
      transform: translateY(12px);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .ui-toast {
      animation: ui-toast-out 1ms linear 6s forwards;
    }
    .ui-btn {
      transition: none;
    }
  }

  /* ---------- Two answers side by side (ui.pair): the same width, even on a phone ---------- */
  .ui-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }
  .ui-pair > div {
    display: flex;
    min-width: 0;
  }
  .ui-pair > div > form,
  .ui-pair > div > details {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }
  .ui-pair > div > .ui-btn,
  .ui-pair > div > form > .ui-btn,
  .ui-pair .ui-details--button > summary.ui-btn {
    width: 100%;
  }
  /* One answer at a time: while "Decline" shows its form, it takes the row and the other answer steps aside. */
  .ui-pair:has(.ui-details--button[open]) {
    grid-template-columns: minmax(0, 1fr);
  }
  .ui-pair:has(.ui-pair-b .ui-details--button[open]) > .ui-pair-a,
  .ui-pair:has(.ui-pair-a .ui-details--button[open]) > .ui-pair-b {
    display: none;
  }
  .ui-pair--sm .ui-btn {
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  /* ---------- A file's kind, leading its row ---------- */
  .ui-filemark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-ground);
    color: var(--ui-muted);
  }
  .ui-filemark svg {
    width: 20px;
    height: 20px;
  }
  /* A row's decision pair takes the row's width on a phone, its More beside it. */
  .ui-row-actions > .ui-pair {
    flex: 1 1 14rem;
  }
  @media (max-width: 39.99rem) {
    .ui-row-lead:has(> .ui-filemark) {
      display: none;
    }
    .ui-row-actions:has(> .ui-pair) {
      width: 100%;
      margin-left: 0;
    }
  }

  /* ---------- A reviewer (ui.reviewer): the document big, the inspector beside it ---------- */
  .ui-reviewer {
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
    background: var(--ui-ground);
  }
  .ui-reviewer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ui-line);
    background: var(--ui-surface);
  }
  .ui-reviewer-bar .ui-back {
    margin: 0;
  }
  .ui-reviewer-title {
    min-width: 0;
    flex: 1 1 14rem;
  }
  .ui-reviewer-title h1 {
    margin: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ui-ink);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ui-reviewer-title p {
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    color: var(--ui-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ui-reviewer-nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .ui-reviewer-nav [aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
  }
  .ui-reviewer-pos {
    min-width: 4.5em;
    font-size: 14px;
    color: var(--ui-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .ui-reviewer-body {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 1fr);
  }
  .ui-reviewer-doc {
    position: relative;
    display: flex;
    height: 72vh;
    min-height: 22rem;
    flex-direction: column;
    background: #e9e7e2;
  }
  .ui-reviewer-side {
    padding: 4px 16px 24px;
    background: var(--ui-surface);
  }
  @media (min-width: 64rem) {
    .ui-reviewer {
      height: 100dvh;
      min-height: 0;
    }
    .ui-reviewer-body {
      min-height: 0;
      grid-template-columns: minmax(0, 1fr) 24rem;
    }
    .ui-reviewer-doc {
      height: auto;
      min-height: 0;
    }
    .ui-reviewer-side {
      overflow-y: auto;
      border-left: 1px solid var(--ui-line);
    }
  }
  .ui-inspector-part {
    padding: 18px 0;
  }
  .ui-inspector-part + .ui-inspector-part {
    border-top: 1px solid var(--ui-line);
  }
  .ui-inspector-part > * + * {
    margin-top: 10px;
  }
  .ui-inspector-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ui-muted);
  }
  .ui-inspector-part .ui-banner {
    margin-bottom: 0;
  }
  /* The document: PDF.js in a frame filling the pane; a photo fitted (core-reviewer zooms it); or what to do instead. */
  .ui-docview-frame {
    width: 100%;
    flex: 1;
    border: 0;
    background: #e9e7e2;
  }
  .ui-docview-stage {
    display: grid;
    flex: 1;
    min-height: 0;
    place-items: center;
    overflow: auto;
    padding: 16px;
  }
  .ui-docview-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: var(--ui-surface);
    box-shadow: 0 8px 30px rgb(20 33 58 / 0.18);
  }
  .ui-docview-stage[data-zoom] {
    place-items: start center;
  }
  .ui-docview-stage[data-zoom] .ui-docview-img {
    max-width: none;
    max-height: none;
  }
  .ui-docview-tools {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-surface);
    box-shadow: 0 6px 20px rgb(20 33 58 / 0.2);
  }
  .ui-docview-tools[hidden] {
    display: none;
  }
  .ui-docview-empty {
    display: grid;
    flex: 1;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    color: var(--ui-body);
  }
  .ui-docview-empty > svg {
    width: 40px;
    height: 40px;
    color: var(--ui-muted);
  }
}
