@layer components {
  /* The order page: the checkout while unpaid (step 4), then the order once paid (step 5); and the pages
   * where the flow stops. */

  /* ---- Step 4: the checkout ----
   * The approved design (../landing/pages/checkout/design.html, 27 Nov 2026), on the flow's two sides
   * (.flow-page--pay, flow.css), while the order is unpaid and while its payment is confirmed. Left: the
   * headline, then Paddle's frame, or what stands in its place, and the line about Paddle and the terms.
   * Right: the order, after the homepage's receipt. Nothing here styles the inside of Paddle's frame: its
   * colours, corners and heights are set in Paddle's dashboard (../landing/pages/checkout/prototype.md).
   * Under 1024px one column, each part in its place by its order: the headline (2, flow.css), the photo
   * and its name (3), the payment (4), the line (5), the rest of the order (6), the pinned total (7). */

  /* A box with the app's words on the warm white side, in the frame's place or above it: the form that
   * didn't load, the checkout not open yet, the flash alert. Sand with a hairline; red stays on a verdict. */
  .pay-notice {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    font: 400 15px/1.5 var(--font-sans);
    margin-block-start: 20px;
    padding: 16px 18px;
    text-wrap: pretty;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 16px;
    }

    @media (max-width: 1023px) {
      margin-block-start: 16px;
      order: 4;
    }
  }

  /* Paddle's inline frame goes in here; Paddle names its target by this class. It holds the place of
   * Paddle's one-page form at its first height until Paddle draws it. The frame is at least 312px wide
   * (its frameStyle, paddle_checkout_controller.js): on a phone under 352px it takes some of the side space
   * rather than push the page sideways. */
  .paddle-checkout__frame {
    margin-block-start: 20px;
    min-block-size: 450px;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 16px;
    }

    @media (max-width: 1023px) {
      margin-block-start: 16px;
      min-inline-size: min(312px, 100%);
      order: 4;
    }
  }

  /* The test payment, in the frame's place until Paddle is configured: the app's own form, so the brand's
   * field (warm white, a charcoal line, 10px corners, 48px tall) and its main button as wide as the form,
   * inside a dashed outline that says it stands in. */
  .pay-test {
    border: 1.5px dashed color-mix(in srgb, var(--color-ink) 30%, transparent);
    border-radius: var(--rounded-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-block-start: 20px;
    padding: 16px 20px 18px;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 16px;
    }

    @media (max-width: 1023px) {
      margin-block-start: 16px;
      order: 4;
    }

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

  .pay-test__label {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
  }

  .pay-test__field {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .pay-test__name {
    font: 600 14px/1.4 var(--font-sans);
  }

  /* 16px text, so iOS doesn't zoom into it. */
  .pay-test__input {
    background: var(--color-ground);
    block-size: 48px;
    border: 1px solid var(--color-ink);
    border-radius: var(--rounded-md);
    font: 400 16px/1.2 var(--font-sans);
    inline-size: 100%;
    padding: 0 14px;
  }

  .pay-test__note {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
  }

  .pay-test__button {
    inline-size: 100%;
  }

  /* After Pay, in the place of the frame and the line: one status box, with a ring that turns while the
   * payment is confirmed. */
  .pay-status {
    align-items: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    display: flex;
    gap: 14px;
    margin-block-start: 20px;
    padding: 16px 18px;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 16px;
    }

    @media (max-width: 1023px) {
      margin-block-start: 16px;
      order: 4;
    }
  }

  .pay-status__ring {
    block-size: 22px;
    border: 2px solid var(--color-hairline);
    border-block-start-color: var(--color-ink);
    border-radius: var(--rounded-full);
    flex: none;
    inline-size: 22px;
    margin-block-start: 1px;
  }

  .pay-status__title {
    font: 600 17px/1.35 var(--font-sans);
    letter-spacing: -0.01em;
  }

  .pay-status__line {
    color: var(--color-muted);
    font: 400 14px/1.5 var(--font-sans);
    margin-block-start: 2px;
  }

  /* The line under the payment: who takes it, and the two sets of terms the buyer agrees to. */
  .pay-legal {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    margin-block-start: 16px;
    text-wrap: pretty;

    a {
      color: var(--color-ink);
      text-underline-offset: 3px;
    }

    @media (max-width: 1023px) {
      order: 5;
    }
  }

  /* The order: a raised card on the sand side. In one column it is no box: its photo and name and the rest
   * of it are two flat sand cards, one before the payment and one after the line, and its title row goes. */
  .pay-card {
    background: var(--color-ground);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    box-shadow: var(--shadow-raised);
    inline-size: 100%;
    max-inline-size: 404px;
    padding: 20px 24px;

    @media (min-width: 1024px) and (max-height: 780px) {
      padding-block: 16px;
    }

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

  .pay-card__head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-block-size: 28px;

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

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

  .pay-card__ref {
    color: var(--color-muted);
    font: 600 12.5px/1.4 var(--font-sans);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
  }

  .pay-card__item {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-block-start: 14px;

    @media (max-width: 1023px) {
      background: var(--color-surface);
      border: 1px solid var(--color-hairline);
      border-radius: var(--rounded-lg);
      inline-size: calc(100% - 2 * var(--flow-gutter));
      margin: 18px auto 0;
      max-inline-size: var(--flow-column);
      order: 3;
      padding: 10px 14px 10px 10px;
    }
  }

  /* The photo whole, on white where its shape leaves room; the document's own picture, when there is no
   * photo to show, fills the square. */
  .pay-card__thumb,
  .pay-card__picture {
    block-size: 64px;
    border-radius: 8px;
    display: block;
    flex: none;
    inline-size: 64px;
    outline: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
    outline-offset: -1px;

    @media (max-width: 1023px) {
      block-size: 52px;
      inline-size: 52px;
    }
  }

  .pay-card__thumb {
    background: white;
    object-fit: contain;
  }

  .pay-card__picture {
    object-fit: cover;
  }

  .pay-card__name {
    display: block;
    font: 600 16px/1.3 var(--font-sans);
    letter-spacing: -0.01em;
  }

  .pay-card__line {
    color: var(--color-muted);
    display: block;
    font: 400 13.5px/1.4 var(--font-sans);
    margin-block-start: 2px;
  }

  .pay-card__rest {
    margin-block-start: 16px;

    @media (max-width: 1023px) {
      background: var(--color-surface);
      border: 1px solid var(--color-hairline);
      border-radius: var(--rounded-lg);
      inline-size: calc(100% - 2 * var(--flow-gutter));
      margin: 20px auto 28px;
      max-inline-size: var(--flow-column);
      order: 6;
      padding: 4px 18px 18px;
    }
  }

  /* The subtotal and the tax between hairlines, then the total in the headline weight over a charcoal line.
   * The amounts are Paddle's and follow the country the buyer picks in its frame. */
  .pay-lines {
    margin: 0;
  }

  .pay-lines__line {
    align-items: baseline;
    border-block-start: 1px solid var(--color-hairline);
    display: flex;
    font: 400 14.5px/1.4 var(--font-sans);
    gap: 16px;
    justify-content: space-between;
    padding-block: 9px;

    small {
      color: var(--color-muted);
      display: block;
      font-size: 12.5px;
      margin-block-start: 1px;
    }

    dd {
      font-variant-numeric: tabular-nums;
      font-weight: 600;
      margin: 0;
      white-space: nowrap;
    }

    @media (max-width: 1023px) {
      &:first-child { border-block-start: 0; }
    }
  }

  .pay-lines__line--total {
    align-items: center;
    border-block-start-color: var(--color-ink);
    padding-block: 12px 14px;

    dt {
      font-size: 17px;
      font-weight: 700;
      letter-spacing: -0.01em;
    }

    small {
      font-weight: 400;
      letter-spacing: 0;
    }

    dd {
      font-size: 26px;
      font-weight: 800;
      letter-spacing: -0.02em;
      line-height: 1.1;
    }
  }

  /* The homepage's three ticks. */
  .pay-ticks {
    border-block-start: 1px solid var(--color-hairline);
    display: grid;
    font: 500 14.5px/1.4 var(--font-sans);
    gap: 9px;
    padding-block-start: 14px;

    li {
      align-items: center;
      display: flex;
      gap: 9px;
    }
  }

  /* The total pinned to the bottom of the screen in one column, flat with a hairline above it: Paddle's
   * Pay button is inside its frame and can't be pinned. */
  .pay-bar {
    display: none;

    @media (max-width: 1023px) {
      align-items: center;
      background: var(--color-ground);
      border-block-start: 1px solid var(--color-hairline);
      display: flex;
      gap: 16px;
      inset-block-end: 0;
      justify-content: space-between;
      margin-block-start: auto;
      order: 7;
      padding: 12px var(--flow-gutter) calc(12px + env(safe-area-inset-bottom, 0px));
      position: sticky;
      z-index: 6;
    }
  }

  .pay-bar__label {
    b {
      display: block;
      font: 700 16px/1.3 var(--font-sans);
    }

    small {
      color: var(--color-muted);
      display: block;
      font: 400 12.5px/1.4 var(--font-sans);
    }
  }

  .pay-bar__sum {
    font: 800 24px/1.6 var(--font-sans);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
  }

  /* Movement, only with motion allowed: the ring turns while the payment is confirmed, and an amount
   * Paddle changes fades in (paddle_checkout_controller.js). With reduced motion the ring stands still. */
  @media screen and (prefers-reduced-motion: no-preference) {
    .pay-status__ring {
      animation: pay-spin 0.9s linear infinite;
    }

    .pay-lines__line dd.is-new {
      animation: pay-new 320ms ease both;
    }
  }

  @keyframes pay-spin {
    to { transform: rotate(360deg); }
  }

  @keyframes pay-new {
    from { opacity: 0; }
  }

  /* The card "Your order" once paid (orders/_paid_summary), when IDshot no longer has the photo to show: step
   * 4's card with the document's picture whole on white, the payment and the refund or the day the order
   * closed, and no ticks. In one column it stays one card, flat and sand, as the card "Your photo" does. */
  .pay-card--paid {
    padding-block-end: 12px;

    .pay-lines {
      margin-block-start: 16px;
    }

    .pay-lines__line {
      padding-block: 10px;
    }

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

      .pay-card__head { display: flex; }

      .pay-card__item {
        background: none;
        border: 0;
        border-radius: 0;
        inline-size: auto;
        margin: 14px 0 0;
        max-inline-size: none;
        padding: 0;
      }

      .pay-card__thumb {
        block-size: 64px;
        inline-size: 64px;
      }

      .pay-lines__line:first-child { border-block-start: 1px solid var(--color-hairline); }
    }

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

    @media (max-width: 379px) {
      padding-inline: 14px;
    }
  }

  /* ---- Step 5: the order once paid ----
   * The approved design (../landing/pages/order-page/design.html, 28 Nov 2026), on the flow's two sides
   * (.flow-page--done, flow.css), in the six states the app shows on this address: the file being prepared,
   * the photo ready, verified, retake needed, refunded, closed (orders/_paid). Left: the headline, one line
   * with the email and the order, the main button, the sheet to print, and one list that says where the
   * order is. Right: the card "Your photo" with the photo at a size to judge it, or step 4's card "Your
   * order" once IDshot no longer has the photo. After PhotoAiD's page: "Thank you" in the headline with the
   * email and the order under it, the status as the clearest line after the file, the sheet as an item with
   * its own small picture. */

  /* The line under the headline: the email and the order. On "Retake needed" it is the expert's reason, in
   * charcoal. */
  .done-lede {
    color: var(--color-muted);
    font: 400 17px/1.5 var(--font-sans);
    margin-block-start: 12px;
    max-inline-size: 34em;
    text-wrap: pretty;

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

    a {
      color: var(--color-ink);
      text-underline-offset: 3px;
    }

    @media (min-width: 1024px) and (max-height: 780px) {
      font-size: 16px;
      margin-block-start: 8px;
    }

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

  .done-lede--reason {
    color: var(--color-ink);
  }

  /* On "Closed", the way to a new photo, in charcoal before its button. */
  .done-ask {
    font: 400 16px/1.5 var(--font-sans);
    margin-block-start: 16px;
    text-wrap: pretty;
  }

  /* One main button as wide as the column. While the file is prepared it is there but grey and can't be
   * pressed. In one column it is pinned to the bottom of the screen, flat with a hairline above it. */
  .done-actions {
    margin-block-start: 20px;

    .btn {
      --icon-size: 20px;

      display: flex;
      gap: 8px;
      inline-size: 100%;
    }

    .btn[aria-disabled="true"] {
      --btn-background: var(--color-surface);
      --btn-color: var(--color-muted);
      --btn-hover-filter: none;

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

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 16px;
    }

    @media (max-width: 1023px) {
      background: var(--color-ground);
      border-block-start: 1px solid var(--color-hairline);
      inline-size: 100%;
      inset-block-end: 0;
      margin-block-start: auto;
      order: 9;
      padding: 12px var(--flow-gutter) calc(12px + env(safe-area-inset-bottom, 0px));
      position: sticky;
      z-index: 6;

      .btn {
        margin-inline: auto;
        max-inline-size: var(--flow-column);
      }
    }
  }

  /* A small line: under the button on "Retake needed" and "Closed", and under the way to a new photo. */
  .done-hint {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    margin-block-start: 10px;
    text-wrap: pretty;
  }

  /* The sheet to print: a flat sand row (warm white in one column, on the sand card's side of nothing) with a
   * small drawing of the sheet, its name, a small outline button and the document's own line under them. */
  .done-sheet {
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    column-gap: 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin-block-start: 18px;
    padding: 12px 14px 13px 12px;
    row-gap: 9px;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 14px;
    }

    @media (max-width: 1023px) {
      background: var(--color-ground);
    }

    @media (max-width: 379px) {
      column-gap: 10px;
    }
  }

  /* The sheet in its own shape (aspect-ratio, from Photo::Sheet), 44px tall: its copies where the sheet has
   * them, and a line for its caption under them. */
  .done-sheet__picture {
    background: white;
    block-size: 44px;
    border-radius: 3px;
    display: block;
    outline: 1px solid color-mix(in srgb, var(--color-ink) 16%, transparent);
    outline-offset: -1px;
    position: relative;

    &::before {
      background: var(--color-hairline);
      block-size: 2px;
      border-radius: 1px;
      content: "";
      inline-size: 40%;
      inset-block-end: 10%;
      inset-inline-start: 5%;
      position: absolute;
    }

    @media (max-width: 379px) {
      block-size: 36px;
    }
  }

  .done-sheet__copy {
    display: block;
    object-fit: cover;
    position: absolute;
  }

  .done-sheet__name {
    font: 600 15.5px/1.3 var(--font-sans);
    letter-spacing: -0.01em;
  }

  /* The small outline button, on warm white; the area to tap is 45px tall. */
  .done-sheet__button {
    .done-sheet & {
      --btn-background: var(--color-ground);
      --icon-size: 16px;

      gap: 6px;
    }

    &::after {
      content: "";
      inset: -4px 0;
      position: absolute;
    }
  }

  .done-sheet__hint {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    grid-column: 1 / -1;
    text-wrap: pretty;
  }

  /* Where the order is, drawn as step 3 draws its stages, a little smaller. Done: the brand's tick. Now: a
   * charcoal dot with a ring that turns. To come: a hairline circle and grey words. The refund's three steps
   * are the same list. */
  .done-track {
    border-block-start: 1px solid var(--color-hairline);
    margin-block-start: 22px;
    padding-block-start: 20px;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 18px;
      padding-block-start: 16px;
    }
  }

  .done-track__row {
    column-gap: 14px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    min-block-size: 58px;
    padding-block-end: 12px;
    position: relative;

    /* The line down to the next row, charcoal under a row done; the ring of the row going on stands 6px
     * outside its dot, so the line stops short of it. */
    &:not(:last-child)::before {
      border-inline-start: 1.5px solid var(--color-hairline);
      content: "";
      inset-block: 32px 4px;
      inset-inline-start: 13.25px;
      position: absolute;
    }

    &:has(+ .done-track__row--now)::before {
      inset-block-end: 10px;
    }

    @media (min-width: 1024px) and (max-height: 780px) {
      min-block-size: 48px;
      padding-block-end: 6px;
    }

    &:last-child {
      min-block-size: 28px;
      padding-block-end: 0;
    }
  }

  .done-track__row--done:not(:last-child)::before {
    border-color: color-mix(in srgb, var(--color-ink) 45%, transparent);
  }

  .done-track__row--now:not(:last-child)::before {
    inset-block-start: 38px;
  }

  .done-track__dot {
    block-size: 28px;
    border: 1.5px solid var(--color-hairline);
    border-radius: var(--rounded-full);
    inline-size: 28px;
    position: relative;

    .done-track__row--done > & {
      background: var(--color-accent-soft);
      border-color: transparent;

      &::after {
        background-color: var(--color-ink);
        content: "";
        inset: 0;
        mask: url("/assets/icons/tick-54b0ab86.svg") center / 66% no-repeat;
        position: absolute;
      }
    }

    .done-track__row--now > & {
      background: var(--color-ink);
      border-color: var(--color-ink);

      &::after {
        background: var(--color-ground);
        border-radius: var(--rounded-full);
        content: "";
        inset: 8px;
        position: absolute;
      }

      /* The ring around it, which turns. */
      &::before {
        border: 1.5px solid var(--color-hairline);
        border-block-start-color: var(--color-ink);
        border-radius: var(--rounded-full);
        content: "";
        inset: -6px;
        position: absolute;
      }
    }
  }

  .done-track__text {
    align-self: start;
    min-inline-size: 0;
    padding-block-start: 3px;
  }

  .done-track__title {
    color: var(--color-muted);
    display: block;
    font: 400 16px/1.4 var(--font-sans);
    text-wrap: pretty;

    .done-track__row--done & {
      color: var(--color-ink);
      font-weight: 500;
    }

    .done-track__row--now & {
      color: var(--color-ink);
      font-weight: 600;
    }
  }

  .done-track__detail {
    color: var(--color-muted);
    display: block;
    font: 400 13.5px/1.45 var(--font-sans);
    font-variant-numeric: tabular-nums;
    margin-block-start: 1px;
    text-wrap: pretty;
  }

  /* A box with the app's words where there is nothing to press: the photo deleted, a refund Paddle hasn't
   * made; and the flash alert. */
  .done-notice {
    background: var(--color-surface);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-lg);
    font: 400 15px/1.5 var(--font-sans);
    margin-block-start: 20px;
    padding: 14px 16px;
    text-wrap: pretty;

    a {
      color: var(--color-ink);
      text-underline-offset: 3px;
    }
  }

  /* After a refund: the way to a new photo, offered quietly under a hairline, with the outline button. */
  .done-again {
    border-block-start: 1px solid var(--color-hairline);
    margin-block-start: 24px;
    padding-block-start: 22px;

    .done-hint { margin-block-start: 10px; }
  }

  .done-again__title {
    font: var(--text-h3);
    letter-spacing: -0.01em;
  }

  .done-again__line {
    color: var(--color-muted);
    font: 400 15px/1.5 var(--font-sans);
    margin-block-start: 4px;
  }

  .done-again__button {
    margin-block-start: 14px;

    .done-again & {
      min-block-size: 44px;
      padding-inline: 18px;
    }
  }

  /* The last small line: the promise once verified, the retakes left on "Retake needed". */
  .done-note {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    margin-block-start: 18px;
    text-wrap: pretty;

    @media (min-width: 1024px) and (max-height: 780px) {
      margin-block-start: 14px;
    }
  }

  /* The card "Your photo" on the sand side, raised; flat and sand in one column, where it floats over nothing.
   * The photo stands in the document's shape (--shape, its width over its height), as large as the card and
   * the window allow: --done-h is the tallest it gets. */
  .done-card {
    --done-h: 356px;

    background: var(--color-ground);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    box-shadow: var(--shadow-raised);
    inline-size: 100%;
    max-inline-size: 404px;
    padding: 20px 24px 18px;

    /* A low window (a small laptop): a smaller photo. */
    @media (min-width: 1024px) and (max-height: 780px) {
      --done-h: 290px;

      padding-block: 16px;
    }

    @media (min-width: 1024px) and (max-height: 660px) {
      --done-h: 232px;
    }

    @media (max-width: 1023px) {
      --done-h: 300px;

      background: var(--color-surface);
      border-radius: var(--rounded-lg);
      box-shadow: none;
      max-inline-size: none;
    }

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

    @media (max-width: 379px) {
      padding-inline: 14px;
    }
  }

  .done-card__head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-block-size: 28px;
  }

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

  /* What the photo is: "Preparing" while its edges are filled, then nothing, then "Verified by an expert". */
  .done-card__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;
    padding: 3px 12px;
  }

  /* The brand's verdicts (.chip), as tall as the design draws them on this card. */
  .done-card__chip,
  .done-card__flag {
    .done-card & {
      block-size: 26px;
      flex: none;
      line-height: 1;
      padding-block: 0;

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

  .done-card__figure {
    inline-size: min(100%, 356px, calc(var(--done-h) * var(--shape, 1)));
    margin: 12px auto 0;
  }

  .done-card__photo {
    aspect-ratio: var(--shape, 1);
    background: var(--color-surface);
    border-radius: var(--rounded-md);
    outline: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
    outline-offset: -1px;
    overflow: hidden;
    position: relative;
  }

  /* While its edges are filled: the photo's own frame over hatching where they will be drawn. */
  .done-card__photo--preparing {
    background: repeating-linear-gradient(-45deg, var(--color-hairline) 0 6px, var(--color-surface) 6px 12px);
  }

  .done-card__image {
    block-size: 100%;
    display: block;
    inline-size: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
  }

  /* The photo the expert looked at, whole: the original, when there is no finished file, has a shape of its own. */
  .done-card__image--whole {
    object-fit: contain;
  }

  /* On "Retake needed": the reason's name on the photo, the brand's failed verdict. The only red on the page. */
  .done-card__flag {
    inset-block-start: 10px;
    inset-inline-end: 10px;
    position: absolute;
  }

  .done-card__file {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 1px 12px;
    justify-content: space-between;
    margin-block-start: 12px;
  }

  .done-card__name {
    font: 600 15px/1.4 var(--font-sans);
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
  }

  .done-card__meta {
    color: var(--color-muted);
    font: 400 13px/1.4 var(--font-sans);
    font-variant-numeric: tabular-nums;
  }

  .done-card__caption {
    border-block-start: 1px solid var(--color-hairline);
    color: var(--color-muted);
    font: 400 12.5px/1.45 var(--font-sans);
    margin-block-start: 12px;
    padding-block-start: 10px;
    text-wrap: pretty;
  }

  /* Movement, only with motion allowed: the ring of the row going on turns, and the hatching moves while the
   * file is prepared. On a full load (html.js-motion, layouts/shared/_motion) the ticks land one after the
   * other and the expert's tag after them, once; a refresh shows them as they are (refresh_controller.js).
   * With reduced motion everything stands still. */
  @media screen and (prefers-reduced-motion: no-preference) {
    .done-track__row--now > .done-track__dot::before {
      animation: done-spin 0.9s linear infinite;
    }

    .done-card__photo--preparing {
      animation: done-hatch 1.1s linear infinite;
    }

    .js-motion .done-track__row--done > .done-track__dot {
      animation: done-pop 380ms cubic-bezier(0.22, 1, 0.36, 1) calc(260ms + var(--i, 0) * 90ms) both;
    }

    .js-motion .done-card__chip {
      animation: done-pop 380ms cubic-bezier(0.22, 1, 0.36, 1) 300ms both;
    }
  }

  @keyframes done-spin {
    to { transform: rotate(360deg); }
  }

  /* One repeat of the hatching along its stripes: 12px across them, 12√2 ≈ 16.97px along the row. */
  @keyframes done-hatch {
    to { background-position: 16.97px 0; }
  }

  @keyframes done-pop {
    from { opacity: 0; transform: scale(0.8); }
  }

  /* ---- Where the flow stops ----
   * The approved design (../landing/pages/order-not-here/design.html, 28 Nov 2026) of the pages where the
   * flow stops (orders/_stop): an order that isn't there (orders/missing), a file the server didn't accept, a
   * photo or a retake (orders/rejected), and too many photos from one connection (orders/too_many). Not steps:
   * no bars, no step line and no second side, since there is no photo, document or order to show. The sand
   * with dots of the steps' card side over the whole page, the logo where the steps have it, and in the
   * middle, a little above it, one raised card: the headline, one sentence, one button as wide as the card
   * and at most one small line under it. No header and no footer. */

  /* The page's own colour is the sand too. The canvas takes the body's colour, as on the steps (base.css),
   * so what a browser shows past the page (overscroll on a phone) is sand and not warm white. */
  body:has(> .stop) {
    background: var(--color-surface);
  }

  .stop {
    background-color: var(--color-surface);
    background-image: radial-gradient(var(--color-hairline) 1px, transparent 1.5px);
    background-size: 22px 22px;
    display: flex;
    flex-direction: column;
    min-block-size: 100vh;
    min-block-size: 100dvh;
  }

  /* The logo row: the steps' own measures, 40px from the side and 22px from the top. */
  .stop__top {
    display: flex;
    padding: 22px 40px 0;

    .logo {
      display: flex;
      flex: none;
    }

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

  /* The card stands in the middle, a little above it: the space under it is the taller one. In a low window
   * there is less space round it; a phone has the steps' 20px at the sides. */
  .stop__main {
    display: grid;
    flex: 1;
    padding: 32px 24px clamp(48px, 16vh, 160px);
    place-items: center;

    @media (max-height: 560px) {
      padding-block: 20px 28px;
    }

    @media (max-width: 600px) {
      padding: 24px 20px clamp(40px, 14vh, 120px);
    }
  }

  /* One button as wide as the card, the main one or, on "Too many photos", the outline one at its height. */
  .stop__card {
    background: var(--color-ground);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    box-shadow: var(--shadow-raised);
    inline-size: 100%;
    max-inline-size: 480px;
    padding: 32px 32px 30px;

    .btn {
      --icon-size: 20px;

      display: flex;
      gap: 8px;
      inline-size: 100%;
      margin-block-start: 24px;
    }

    @media (max-width: 600px) {
      padding: 24px 22px;

      .btn { margin-block-start: 20px; }
    }
  }

  .stop__title {
    font: 800 32px/1.1 var(--font-sans);
    letter-spacing: -0.025em;

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

  /* A link in the card's words, the address to write to, and only there: a rule for every link of the card
   * would catch the outline button too and outrank its hover, and its words would stay charcoal on its
   * charcoal fill. */
  .stop__text {
    color: var(--color-muted);
    font: 400 17px/1.5 var(--font-sans);
    margin-block-start: 12px;
    text-wrap: pretty;

    a { text-underline-offset: 3px; }

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

  .stop__note {
    color: var(--color-muted);
    font: 400 13px/1.5 var(--font-sans);
    margin-block-start: 14px;
    text-wrap: pretty;

    a { text-underline-offset: 3px; }
  }
}
