@layer components {
  /* The admin pages, as ../landing/pages/admin/design.html draws them (approved 28 Nov 2026): the founder's own
   * pages, behind a password, often used on a phone. A tool, so nothing moves and nothing is decoration. One bar
   * at the top of every page (admin/_frame), no footer. The lists (the queue, the orders found, the problems) are
   * one flat sand card with a hairline between rows; one order is the flow's two sides, the work on the left and
   * the photos on the right in a raised card on the sand that stays in view; the funnel's tables each sit in a
   * card that scrolls sideways. A colour rule for links is the base one, for links in running text: none here
   * may outrank the outline button's hover, whose words would stay charcoal on its charcoal fill. */
  .admin {
    --admin-bar: 60px;
    --admin-gutter: 40px;

    min-block-size: 100vh;
    min-block-size: 100dvh;

    /* The brand's pass tag (.chip--pass, chips.css), "verified" and "resolved", at the admin tags' height. */
    .chip {
      block-size: 26px;
      font-variant-numeric: tabular-nums;
      line-height: 1;
      padding-block: 0;

      &::before {
        block-size: 14px;
        inline-size: 14px;
      }
    }

    @media (max-width: 1023px) {
      --admin-gutter: 32px;
    }

    @media (max-width: 600px) {
      --admin-gutter: 20px;
    }
  }

  /* The bar: the logo, the pages as tabs, the tag "Admin". It stays at the top; under 1024px the tabs take a
   * row of their own and scroll sideways. The tabs' row has room round it for a tab's focus ring. */
  .admin-bar {
    align-items: center;
    background: var(--color-ground);
    border-block-end: 1px solid var(--color-hairline);
    display: flex;
    gap: 8px 24px;
    inset-block-start: 0;
    min-block-size: var(--admin-bar);
    padding-inline: var(--admin-gutter);
    position: sticky;
    z-index: 20;

    .logo {
      flex: none;
    }

    @media (max-width: 1023px) {
      flex-wrap: wrap;
      padding-block-start: 10px;
    }
  }

  .admin-bar__nav {
    align-items: center;
    display: flex;
    gap: 2px;
    margin: -6px;
    min-inline-size: 0;
    overflow-x: auto;
    padding: 6px;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }

    @media (max-width: 1023px) {
      flex-basis: calc(100% + 12px);
      margin: -6px -18px;
      order: 3;
      padding: 6px 6px 12px;
    }
  }

  /* Charcoal words, as the approved page shows them; under the mouse the sand fill. */
  .admin-bar__tab {
    align-items: center;
    block-size: 36px;
    border-radius: var(--rounded-md);
    color: var(--color-ink);
    display: inline-flex;
    flex: none;
    font: 500 14.5px/1 var(--font-sans);
    gap: 7px;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;

    &:hover {
      background: var(--color-surface);
      color: var(--color-ink);
    }

    &[aria-current="page"] {
      background: var(--color-surface);
      box-shadow: inset 0 0 0 1px var(--color-hairline);
      color: var(--color-ink);
      font-weight: 600;
    }
  }

  /* How many photos wait, how many problems are open. */
  .admin-bar__count {
    background: var(--color-accent-soft);
    block-size: 20px;
    border-radius: var(--rounded-full);
    color: var(--color-ink);
    display: inline-grid;
    font: 600 12px/1 var(--font-sans);
    font-variant-numeric: tabular-nums;
    min-inline-size: 20px;
    padding: 0 6px;
    place-items: center;
  }

  /* Before "Jobs" and "Emails", which lead out of these pages. */
  .admin-bar__gap {
    background: var(--color-hairline);
    block-size: 18px;
    flex: none;
    inline-size: 1px;
    margin-inline: 8px;
  }

  .admin-bar__tag {
    background: var(--color-accent-soft);
    border-radius: var(--rounded-full);
    color: var(--color-ink);
    flex: none;
    font: var(--text-label);
    letter-spacing: 0.02em;
    margin-inline-start: auto;
    padding: 4px 12px;
    white-space: nowrap;
  }

  /* A page of one column: 1160px of content at most, 860px for one problem. */
  .admin-page {
    inline-size: 100%;
    margin-inline: auto;
    max-inline-size: calc(1160px + 2 * var(--admin-gutter));
    padding: 36px var(--admin-gutter) 72px;

    @media (max-width: 1023px) {
      padding-block-start: 28px;
    }
  }

  .admin-page--narrow {
    max-inline-size: calc(860px + 2 * var(--admin-gutter));
  }

  /* The headline and its sentence on the left, the search on the right. */
  .admin-head {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    justify-content: space-between;
  }

  .admin-kicker {
    color: var(--color-muted);
    font: 600 13px/1.4 var(--font-sans);
  }

  .admin-title {
    color: var(--color-ink);
    font: 800 32px/1.1 var(--font-sans);
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
    text-wrap: balance;

    .admin-kicker + & {
      margin-block-start: 4px;
    }

    @media (max-width: 600px) {
      font-size: 28px;
    }
  }

  .admin-lede {
    color: var(--color-muted);
    font: 400 16px/1.5 var(--font-sans);
    margin-block-start: 6px;
    max-inline-size: 46em;
    text-wrap: pretty;
  }

  /* A title in the page: the funnel's tables, the resolved problems. Its sentence, its fold or its rows follow
   * it closely. */
  .admin-subtitle {
    font: 700 19px/1.3 var(--font-sans);
    letter-spacing: -0.01em;
    margin-block-start: 36px;
    text-wrap: wrap;

    + :is(.admin-hint, .admin-fold) {
      margin-block-start: 6px;
    }

    + .admin-rows {
      margin-block-start: 12px;
    }
  }

  .admin-hint {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    margin-block-start: 8px;
    text-wrap: pretty;
  }

  /* What an action answered, on top of the page it leads to. An alert has a charcoal edge. */
  .admin-flash {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    font: 400 14px/1.45 var(--font-sans);
    margin-block-end: 20px;
    padding: 10px 14px;
  }

  .admin-flash--alert {
    box-shadow: inset 3px 0 0 var(--color-ink);
    font-weight: 600;
  }

  /* Find an order: one field and the small outline button, at the field's height. */
  .admin-find {
    align-items: center;
    display: flex;
    gap: 8px;

    .btn {
      min-block-size: 40px;
    }

    @media (max-width: 720px) {
      inline-size: 100%;
    }
  }

  .admin-find__field {
    background: var(--color-ground);
    block-size: 40px;
    border: 1px solid var(--color-muted);
    border-radius: var(--rounded-md);
    color: var(--color-ink);
    font: 400 15px var(--font-sans);
    inline-size: 260px;
    padding: 0 12px;

    &::placeholder {
      color: var(--color-muted);
    }

    @media (max-width: 720px) {
      flex: 1;
      inline-size: auto;
      min-inline-size: 0;
    }
  }

  .admin-find__field,
  .admin-select,
  .admin-area {
    &:focus-visible {
      outline: 2px solid var(--color-ink);
      outline-offset: 2px;
    }
  }

  /* A list: one flat sand card, a hairline between rows. */
  .admin-rows {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    margin-block-start: 24px;
    overflow: hidden;

    > li + li {
      border-block-start: 1px solid var(--color-hairline);
    }
  }

  /* A row, the whole of it a link that turns warm white under the mouse, its columns in line from row to row,
   * ending in a tag. Under 720px the tag stands next to the name and the rest goes under them. */
  .admin-row {
    align-items: center;
    color: var(--color-ink);
    display: grid;
    gap: 2px 20px;
    grid-template-columns: 136px minmax(0, 1.1fr) minmax(0, 1.2fr) 204px;
    min-block-size: 64px;
    padding: 12px 18px;
    text-decoration: none;

    &:hover {
      background: var(--color-ground);
    }

    &:focus-visible {
      outline-offset: -3px;
    }

    /* The document being read, on the document test page: warm white with a charcoal edge, as an alert's. */
    &[aria-current="page"] {
      background: var(--color-ground);
      box-shadow: inset 3px 0 0 var(--color-ink);
    }

    > :last-child {
      justify-self: end;
    }

    @media (max-width: 720px) {
      grid-template-columns: minmax(0, 1fr) auto;

      > :nth-child(2),
      > :nth-child(3) {
        grid-column: 1 / -1;
      }

      > :last-child {
        align-self: center;
        grid-column: 2;
        grid-row: 1;
      }
    }
  }

  .admin-row__name {
    font: 700 17px/1.3 var(--font-sans);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
  }

  .admin-row__kind {
    font: 400 14.5px/1.4 var(--font-sans);
  }

  .admin-row__when {
    color: var(--color-muted);
    font: 400 13.5px/1.4 var(--font-sans);
    font-variant-numeric: tabular-nums;
  }

  /* A photo in the queue: room in the last column for its pre-review's tag beside its due tag. Under 720px one
   * column, the two tags on a line of their own under the round and the wait, so the reference stays whole. */
  .admin-row--waiting {
    grid-template-columns: 136px minmax(0, 1fr) minmax(0, 1fr) 280px;

    @media (max-width: 720px) {
      grid-template-columns: minmax(0, 1fr);

      > :last-child {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
        margin-block-start: 6px;
      }
    }
  }

  /* A photo's pre-review tag, then its due tag; the due tag goes under it when the two don't fit. */
  .admin-row__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: end;

    @media (max-width: 720px) {
      justify-content: start;
    }
  }

  /* A problem: its class with its message under it, where and when, and the tag. One column under 720px. */
  .admin-row--problem {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 104px;

    .admin-row__kind {
      color: var(--color-muted);
      display: block;
      font-size: 13.5px;
      margin-block-start: 1px;
      overflow-wrap: anywhere;
    }

    @media (max-width: 720px) {
      grid-template-columns: minmax(0, 1fr);

      > :last-child {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
        margin-block-start: 4px;
      }
    }
  }

  /* A document on the document test page: its name with its sizes and the gate's steps to do under it, and the
   * chip of its result. */
  .admin-row--document {
    gap: 4px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-block-size: 60px;

    .admin-row__when {
      display: block;
      margin-block-start: 2px;
    }
  }

  /* "Nothing is waiting.", "No open problems.", a problem resolved. */
  .admin-empty {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    font-size: 15px;
    margin-block-start: 24px;
    padding: 18px;
  }

  /* A small tag for a time or a state: plain (warm white, a hairline) or late (charcoal). Done is the brand's
   * pass tag (.chip--pass, sized in .admin). No red: red is the applicant's "Failed". */
  .admin-tag {
    align-items: center;
    background: var(--color-ground);
    block-size: 26px;
    border-radius: var(--rounded-full);
    box-shadow: inset 0 0 0 1px var(--color-hairline);
    color: var(--color-ink);
    display: inline-flex;
    font: 600 13px/1 var(--font-sans);
    font-variant-numeric: tabular-nums;
    gap: 5px;
    padding: 0 11px;
    white-space: nowrap;

    /* The pre-review's "2 flags": the triangle of a borderline for the expert. */
    .icon {
      --icon-size: 14px;
    }
  }

  .admin-tag--late {
    background: var(--color-ink);
    box-shadow: none;
    color: var(--color-ground);
  }

  /* One order: two sides under the bar. Under 1024px one column, the photos right under the order's name: the
   * left side is no box, so its parts and the photos stand in one column, each as wide as it. */
  .admin-order {
    display: grid;
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
    min-block-size: calc(100dvh - var(--admin-bar) - 1px);

    @media (max-width: 1023px) {
      display: flex;
      flex-direction: column;

      &::after {
        block-size: 56px;
        content: "";
        flex: none;
        order: 9;
      }
    }
  }

  .admin-order__work {
    inline-size: 100%;
    margin-inline: auto;
    max-inline-size: calc(600px + 2 * var(--admin-gutter));
    padding: 32px var(--admin-gutter) 72px;

    @media (max-width: 1023px) {
      display: contents;

      > * {
        inline-size: calc(100% - 2 * var(--admin-gutter));
        margin-inline: auto;
        max-inline-size: 680px;
        order: 3;
      }

      > .admin-order__head {
        margin-block-start: 28px;
        order: 1;
      }
    }
  }

  /* The sand with dots of the flow's card side (.flow-page__aside). */
  .admin-order__side {
    background-color: var(--color-surface);
    background-image: radial-gradient(var(--color-hairline) 1px, transparent 1.5px);
    background-size: 22px 22px;
    border-inline-start: 1px solid var(--color-hairline);

    @media (max-width: 1023px) {
      background: none;
      border-inline-start: 0;
      inline-size: calc(100% - 2 * var(--admin-gutter));
      margin-block-start: 20px;
      margin-inline: auto;
      max-inline-size: 680px;
      order: 2;
    }
  }

  /* The photos stay in view while the left side scrolls, and scroll by themselves when taller than the window. */
  .admin-order__photos {
    align-items: center;
    block-size: calc(100dvh - var(--admin-bar) - 1px);
    display: flex;
    flex-direction: column;
    inset-block-start: calc(var(--admin-bar) + 1px);
    overflow-y: auto;
    padding: 24px;
    position: sticky;

    @media (max-width: 1023px) {
      block-size: auto;
      overflow: visible;
      padding: 0;
      position: static;
    }
  }

  /* The tag and the dates under the order's name, or under a problem's. */
  .admin-facts {
    align-items: center;
    color: var(--color-muted);
    display: flex;
    flex-wrap: wrap;
    font: 400 14.5px/1.4 var(--font-sans);
    font-variant-numeric: tabular-nums;
    gap: 8px 10px;
    margin-block-start: 12px;
  }

  /* The photos' card, and the sentence in its place once they are deleted. */
  .admin-shots {
    inline-size: 100%;
    max-inline-size: 620px;
    padding: 18px 18px 16px;
  }

  .admin-gone {
    font: 400 15px/1.5 var(--font-sans);
    max-inline-size: 420px;
    padding: 18px 20px;
  }

  /* Both raised on the sand; flat and sand in one column, where they float over nothing, as wide as it. */
  .admin-shots,
  .admin-gone {
    background: var(--color-ground);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    box-shadow: var(--shadow-raised);
    margin-block: auto;

    @media (max-width: 1023px) {
      background: var(--color-surface);
      border-radius: var(--rounded-lg);
      box-shadow: none;
      max-inline-size: none;
    }
  }

  /* The finished file large, the photo as taken and the prepared image beside it; under 600px they go under
   * it, side by side. */
  .admin-shots__grid {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) clamp(128px, 31%, 188px);

    @media (max-width: 600px) {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .admin-shots__grid--one {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-shots__stack {
    display: grid;
    gap: 12px;
    min-inline-size: 0;

    @media (max-width: 600px) {
      align-items: start;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  .admin-shots__stack--one {
    @media (max-width: 600px) {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  /* A photo, a link to its file at full size, and its name under it. */
  .admin-shot {
    min-inline-size: 0;

    figcaption {
      color: var(--color-muted);
      font: 400 12.5px/1.4 var(--font-sans);
      font-variant-numeric: tabular-nums;
      margin-block-start: 6px;
    }

    b {
      color: var(--color-ink);
      font-weight: 600;
    }
  }

  /* Its outline turns charcoal under the mouse. */
  .admin-shot__frame {
    background: white;
    border-radius: var(--rounded-md);
    display: block;
    outline: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
    outline-offset: -1px;
    overflow: hidden;
    position: relative;

    &:hover {
      outline-color: var(--color-ink);
    }

    &:focus-visible {
      outline: 2px solid var(--color-ink);
      outline-offset: 3px;
    }

    img {
      block-size: auto;
      display: block;
      inline-size: 100%;
    }
  }

  /* The prepared image: the photo's own area dashed and the frame solid, drawn over it in the page, their lines
   * in proportion to the image as the design draws them. */
  .admin-shot__outline {
    block-size: 100%;
    fill: none;
    inline-size: 100%;
    inset: 0;
    position: absolute;
    stroke: var(--color-ink);
    stroke-width: 1.2%;
  }

  .admin-shot__area {
    stroke-dasharray: 4% 3%;
  }

  /* When the checker flags the hair: neither pass nor fail, a borderline for the expert, with an icon of its own,
   * and the finished file at twice its size in a window that scrolls. */
  .admin-edge {
    border-block-start: 1px solid var(--color-hairline);
    margin-block-start: 14px;
    padding-block-start: 12px;
  }

  .admin-edge__title {
    align-items: center;
    display: flex;
    font: 700 14.5px/1.4 var(--font-sans);
    gap: 6px;

    .icon {
      --icon-size: 18px;
    }
  }

  .admin-edge__text {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    margin-block-start: 2px;
    text-wrap: pretty;
  }

  .admin-edge__zoom {
    background: white;
    block-size: 168px;
    border-radius: var(--rounded-md);
    margin-block-start: 8px;
    outline: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
    outline-offset: -1px;
    overflow: auto;

    &:focus-visible {
      outline: 2px solid var(--color-ink);
      outline-offset: 3px;
    }

    img {
      block-size: auto;
      inline-size: 200%;
      max-inline-size: none;
    }
  }

  /* A block of the order's work: a flat sand card. Its buttons are as wide as it; an outline button there is
   * warm white until the mouse fills it with charcoal. */
  .admin-card {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    margin-block-start: 20px;
    padding: 18px;

    .btn {
      display: flex;
      inline-size: 100%;
    }

    .btn--outline {
      --btn-background: var(--color-ground);

      min-block-size: 46px;
      padding-inline: 15px;
    }

    /* "Verified" while the file isn't made: there, but grey. */
    .btn:disabled {
      --btn-background: var(--color-ground);
      --btn-color: var(--color-muted);

      box-shadow: inset 0 0 0 1px var(--color-hairline);
      opacity: 1;
    }

    @media (max-width: 600px) {
      padding: 16px;
    }
  }

  .admin-card__title {
    font: 700 17px/1.3 var(--font-sans);
    letter-spacing: -0.01em;
    text-wrap: wrap;
  }

  .admin-rule {
    background: var(--color-hairline);
    block-size: 1px;
    border: 0;
    margin: 16px 0;
  }

  .admin-label {
    display: block;
    font: 600 14px/1.4 var(--font-sans);
    margin-block-end: 6px;

    + :is(.admin-select, .admin-area) {
      margin-block-end: 12px;
    }
  }

  .admin-select,
  .admin-area {
    background-color: var(--color-ground);
    border: 1px solid var(--color-muted);
    border-radius: var(--rounded-md);
    color: var(--color-ink);
    display: block;
    font: 400 15px/1.4 var(--font-sans);
    inline-size: 100%;
  }

  .admin-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6.25 8 10.25 12 6.25' fill='none' stroke='%231C1E1D' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    block-size: 44px;
    padding: 0 36px 0 12px;
  }

  .admin-area {
    min-block-size: 68px;
    padding: 10px 12px;
    resize: vertical;
  }

  /* What only a person can judge: a small title over each of the two lists, numbered through both. */
  .admin-sub {
    color: var(--color-muted);
    font: 600 12.5px/1.4 var(--font-sans);
    letter-spacing: 0.02em;
    margin-block-start: 14px;
    text-transform: uppercase;
  }

  .admin-judge {
    display: grid;
    font: 400 14.5px/1.5 var(--font-sans);
    gap: 5px;
    list-style: decimal;
    margin-block-start: 8px;
    padding-inline-start: 26px;
    text-wrap: pretty;

    li::marker {
      color: var(--color-muted);
      font-size: 13px;
      font-variant-numeric: tabular-nums;
      font-weight: 600;
    }
  }

  /* The pre-review, at the top of an order's work: "Clean" as the plain tag, or each flag on a line after the
   * triangle of a borderline for the expert; the notes in grey under them. */
  .admin-pre {
    display: grid;
    font: 400 14.5px/1.5 var(--font-sans);
    gap: 6px;
    margin-block-start: 10px;
    text-wrap: pretty;
  }

  .admin-pre--notes {
    color: var(--color-muted);
    font-size: 13.5px;
  }

  .admin-pre__flag {
    align-items: start;
    display: flex;
    gap: 8px;

    .icon {
      --icon-size: 18px;

      flex-shrink: 0;
      margin-block-start: 2px;
    }
  }

  .admin-pre__clean {
    align-items: center;
    display: flex;
    font: 400 14.5px/1.5 var(--font-sans);
    gap: 8px;
    margin-block-start: 10px;
  }

  /* What the check measured: the names in a column, the numbers beside them; under 600px each under its name. */
  .admin-measures {
    display: grid;
    font: 400 13.5px/1.45 var(--font-sans);
    gap: 7px 18px;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 12px 0 0;

    dt {
      font-weight: 600;
    }

    dd {
      color: var(--color-muted);
      font-variant-numeric: tabular-nums;
      margin: 0;
    }

    @media (max-width: 600px) {
      gap: 0;
      grid-template-columns: minmax(0, 1fr);

      dd {
        margin-block-end: 8px;
      }
    }
  }

  /* Earlier photos, the emails sent, the visit: one line each. */
  .admin-log {
    color: var(--color-muted);
    display: grid;
    font: 400 13.5px/1.45 var(--font-sans);
    font-variant-numeric: tabular-nums;
    gap: 5px;
    margin-block-start: 10px;
    overflow-wrap: anywhere;
  }

  /* Folded until opened, with "Show" or "Hide" at the right of its title. */
  .admin-fold {
    > summary {
      align-items: center;
      cursor: pointer;
      display: flex;
      gap: 12px;
      justify-content: space-between;

      &::after {
        content: "Show";
        font-size: 13.5px;
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 3px;
      }
    }

    &[open] > summary::after {
      content: "Hide";
    }
  }

  /* The funnel's fold: the name of its note, as small as the note. */
  .admin-fold__label {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
  }

  .admin-fold__text {
    max-inline-size: 60em;
  }

  /* A table of the funnel, in a card that scrolls sideways when it is wider than the page: the numbers to the
   * right in tabular figures, a first row with the total, and each nought in grey, so a day with something in
   * it stands out. */
  .admin-table {
    background: var(--color-ground);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    margin-block-start: 12px;
    overflow-x: auto;

    table {
      border-collapse: collapse;
      font: 400 13.5px/1.4 var(--font-sans);
      font-variant-numeric: tabular-nums;
      inline-size: 100%;
    }

    th,
    td {
      padding: 7px 12px;
      text-align: end;
      white-space: nowrap;
    }

    thead th {
      background: var(--color-surface);
      color: var(--color-muted);
      font-size: 12.5px;
      font-weight: 600;
      padding-block: 10px;
      vertical-align: bottom;
      white-space: normal;
    }

    th:first-child {
      text-align: start;
    }

    tbody th {
      font-weight: 600;
    }

    tbody tr {
      border-block-start: 1px solid var(--color-hairline);

      &:not(.admin-table__total):hover {
        background: var(--color-surface);
      }
    }

    .admin-table__total :is(th, td) {
      background: var(--color-accent-soft);
      font-weight: 700;
    }
  }

  .admin-table__none {
    color: color-mix(in srgb, var(--color-muted) 45%, transparent);
  }

  /* The document test page: the flow's two sides, as one order's page. The photo and the list of documents on the
   * left; on the right, on the sand with dots, the chosen document's result in a raised card that stays in view and
   * scrolls by itself when taller than the window. Under 1024px one column: the photo, the result, then the list,
   * the left side no box so its parts and the result stand in one column. */
  .admin-test {
    display: grid;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    min-block-size: calc(100dvh - var(--admin-bar) - 1px);

    @media (max-width: 1023px) {
      display: flex;
      flex-direction: column;

      &::after {
        block-size: 56px;
        content: "";
        flex: none;
        order: 9;
      }
    }
  }

  .admin-test__work {
    inline-size: 100%;
    margin-inline: auto;
    max-inline-size: calc(600px + 2 * var(--admin-gutter));
    padding: 32px var(--admin-gutter) 72px;

    @media (max-width: 1023px) {
      display: contents;

      > * {
        inline-size: calc(100% - 2 * var(--admin-gutter));
        margin-inline: auto;
        max-inline-size: 680px;
        order: 3;
      }

      > .admin-test__head {
        margin-block-start: 28px;
        order: 1;
      }

      > .admin-test__photo {
        order: 1;
      }
    }
  }

  /* The photo, once, in a flat sand card: before one, the page's one main button; then a small copy of it, its name,
   * "Change photo" and "Forget photo"; under them, how far the checker has downloaded. */
  .admin-test__add {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: space-between;
  }

  .admin-test__chosen {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 88px minmax(0, 1fr);

    /* A photo this browser can't show (a HEIC in Chrome) hides its copy: the name and the actions take the whole width. */
    &:has(> img[hidden]) {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .admin-test__thumb {
    aspect-ratio: 3 / 4;
    background: white;
    border-radius: var(--rounded-md);
    display: block;
    inline-size: 100%;
    object-fit: cover;
    outline: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
    outline-offset: -1px;
  }

  .admin-test__name {
    font: 600 15px/1.4 var(--font-sans);
    overflow-wrap: anywhere;
  }

  .admin-test__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-block-start: 10px;

    .btn {
      display: inline-flex;
      inline-size: auto;
    }
  }

  /* "Forget photo": a tertiary action, an underlined text link that thickens under the mouse, as links do. */
  .admin-test__forget {
    background: none;
    border: 0;
    color: var(--color-ink);
    cursor: pointer;
    font: 600 14px/1.4 var(--font-sans);
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.2em;

    &:hover {
      text-decoration-thickness: 2px;
    }
  }

  .admin-test__photo .admin-hint {
    margin-block-start: 14px;
  }

  .admin-test__count {
    color: var(--color-muted);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin-inline-start: 4px;
  }

  /* The sand with dots of the flow's card side, as one order's photos have it. */
  .admin-test__side {
    background-color: var(--color-surface);
    background-image: radial-gradient(var(--color-hairline) 1px, transparent 1.5px);
    background-size: 22px 22px;
    border-inline-start: 1px solid var(--color-hairline);

    @media (max-width: 1023px) {
      background: none;
      border-inline-start: 0;
      inline-size: calc(100% - 2 * var(--admin-gutter));
      margin-block-start: 20px;
      margin-inline: auto;
      max-inline-size: 680px;
      order: 2;
    }
  }

  /* The frame the chosen document's result loads into. */
  .admin-test__result {
    block-size: calc(100dvh - var(--admin-bar) - 1px);
    display: block;
    inset-block-start: calc(var(--admin-bar) + 1px);
    overflow-y: auto;
    padding: 24px;
    position: sticky;

    @media (max-width: 1023px) {
      block-size: auto;
      overflow: visible;
      padding: 0;
      position: static;
    }
  }

  /* The result, raised on the sand; flat and sand in one column, where it floats over nothing. Its parts follow one
   * another, a hairline between them. */
  .admin-test__panel,
  .admin-test__choose {
    background: var(--color-ground);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    box-shadow: var(--shadow-raised);
    margin-inline: auto;
    max-inline-size: 640px;
    padding: 22px 22px 24px;

    @media (max-width: 1023px) {
      background: var(--color-surface);
      border-radius: var(--rounded-lg);
      box-shadow: none;
      max-inline-size: none;
    }

    @media (max-width: 600px) {
      padding: 16px;
    }
  }

  /* Clear of the bar, whose tabs take a row of their own in one column. */
  .admin-test__panel {
    scroll-margin-block-start: 124px;
  }

  .admin-test__choose {
    font: 400 15px/1.5 var(--font-sans);
  }

  .admin-test__title {
    font: 800 26px/1.15 var(--font-sans);
    letter-spacing: -0.02em;
    margin-block-start: 4px;
    text-wrap: balance;
  }

  .admin-test__note {
    font: 400 15px/1.5 var(--font-sans);
    margin-block-start: 16px;
    text-wrap: pretty;
  }

  .admin-test__verdict,
  .admin-test__part {
    border-block-start: 1px solid var(--color-hairline);
    margin-block-start: 18px;
    padding-block-start: 16px;
  }

  /* The chip, then the buyer's headline. */
  .admin-test__headline {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font: 700 19px/1.3 var(--font-sans);
    gap: 8px 12px;
    letter-spacing: -0.01em;
  }

  .admin-test__reason {
    font: 400 15px/1.5 var(--font-sans);
    margin-block-start: 8px;
    text-wrap: pretty;
  }

  .admin-test__part-title {
    font: 700 16px/1.3 var(--font-sans);
    letter-spacing: -0.01em;
  }

  .admin-test__text {
    font: 400 14.5px/1.5 var(--font-sans);
    margin-block-start: 6px;
    text-wrap: pretty;
  }

  .admin-test__messages {
    display: grid;
    font: 400 14px/1.45 var(--font-sans);
    gap: 4px;
    list-style: disc;
    margin-block-start: 8px;
    overflow-wrap: anywhere;
    padding-inline-start: 20px;
  }

  /* A file as it would download: the device's, the prepared image, the sheet, the drawn file. */
  .admin-test__shot {
    margin-block-start: 12px;
    max-inline-size: 280px;
  }

  .admin-test__shot--sheet {
    max-inline-size: 100%;
  }

  .admin-test__image {
    background: white;
    border-radius: var(--rounded-md);
    outline: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
    outline-offset: -1px;
    overflow: hidden;
    position: relative;

    img {
      block-size: auto;
      display: block;
      inline-size: 100%;
    }
  }

  .admin-test__download {
    margin-block-start: 12px;

    .icon {
      --icon-size: 17px;
    }
  }

  /* "Draw the edges", the line that says it costs money, and the drawing once it comes. */
  .admin-test__draw {
    margin-block-start: 16px;
  }

  .admin-test__drawn {
    margin-block-start: 14px;

    &:focus {
      outline: none; /* the page moves the focus here once the answer is in, as the button it answers may go */
    }
  }

  /* One problem: its message, the lines of the app's code it went through, and Resolved. */
  .admin-message {
    font: 400 16px/1.55 var(--font-sans);
    margin-block-start: 20px;
    overflow-wrap: anywhere;
  }

  .admin-backtrace {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    font: 400 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
    margin: 14px 0 0;
    overflow-x: auto;
    padding: 14px 16px;
  }

  .admin-resolve {
    margin-block-start: 20px;
  }
}
