/*
 * Product components (cb-*), ported from docs/charte/bundle.css as native nested CSS,
 * without the .cb root that only isolated the design-system previews.
 * Generic controls (buttons, fields, switch, card, table, dropdown, badge) stay Tabler's:
 * nothing here redraws them. Colors come from tokens.css only.
 */

/*
 * The mark of the AI (charter v2, 30 November 2026): the sparkles of Tabler and one color, ai (sage in the light theme,
 * slate blue in the dark one), the cool color facing brand. No gradient anywhere. .cb-ai-icon strokes the sparkles with it.
 */
.cb-ai-icon,
.cb-btn--generate-outline .icon {
    color: var(--ai);
}

/*
 * What the AI made, in a pill (Cb:AiPill): ai on its border and ai-ink for its text, read or not. Solid, ai
 * fills it: the brief waits for a person to read it.
 */
.cb-ai-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 100%;
    padding: 0 var(--space-2);
    border: 1px solid var(--ai);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--ai-ink);
    font: 600 12px/20px var(--font);
    white-space: nowrap;
    vertical-align: middle;

    /* Size only: the stroke comes from .icon */
    & svg {
        flex: none;
        width: 12px;
        height: 12px;
    }
}

.cb-ai-pill--solid {
    gap: 6px;
    padding: 2px 10px;
    border: 0;
    background: var(--ai);
    color: var(--on-ai);
    font-size: 13px;

    & svg {
        width: 14px;
        height: 14px;
    }
}

/* A card that waits for a person to read what the AI prepared (the brief, a deliverable): ai on its border. */
.card.cb-ai-card {
    border: 1px solid var(--ai);
    background: var(--surface-raised);
}

/* The thumbnail of a deliverable the AI proposed and nobody has read yet: ringed with ai. */
.cb-thumb.cb-ai-ring {
    outline: 2px solid var(--ai);
    outline-offset: 2px;
}

/* "L'IA" as a piece of a meta line: the sparkles in ai, then the word. */
.cb-ai-author {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    & svg {
        flex: none;
        width: 14px;
        height: 14px;
    }
}

/*
 * Generation button: modifiers set on a Tabler .btn, through Tabler's own button variables so that hover, active and focus
 * states keep working. The only action that carries the sparkles. The solid one is filled with ai, with an ai-soft ring
 * that widens on hover; the outline one draws ai on its border and its sparkles.
 */
.cb-btn--generate {
    --tblr-btn-color: var(--on-ai);
    --tblr-btn-bg: var(--ai);
    --tblr-btn-border-color: transparent;
    --tblr-btn-hover-color: var(--on-ai);
    --tblr-btn-hover-bg: var(--ai);
    --tblr-btn-hover-border-color: transparent;
    --tblr-btn-active-color: var(--on-ai);
    --tblr-btn-active-bg: var(--ai);
    --tblr-btn-active-border-color: transparent;
    --tblr-btn-box-shadow: 0 0 0 3px var(--ai-soft);

    &:hover {
        --tblr-btn-box-shadow: 0 0 0 4px var(--ai-soft);
    }
}

.cb-btn--generate-outline {
    --tblr-btn-color: var(--ink);
    --tblr-btn-bg: var(--surface-raised);
    --tblr-btn-border-color: var(--ai);
    --tblr-btn-hover-color: var(--ink);
    --tblr-btn-hover-bg: var(--ai-soft);
    --tblr-btn-hover-border-color: var(--ai);
    --tblr-btn-active-color: var(--ink);
    --tblr-btn-active-bg: var(--ai-soft);
    --tblr-btn-active-border-color: var(--ai);
}

/* Status badge, of a project as of a file: written as a sentence, like the status beside the name of a file */
.cb-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 24px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    font: 600 12px/16px var(--font);
    white-space: nowrap;

    /* Size only: a Tabler icon gets its 1.5px stroke from .icon */
    & svg {
        width: 14px;
        height: 14px;
    }
}

.cb-badge--brief {
    background: var(--info-soft);
    color: var(--info);
}

.cb-badge--draft {
    background: var(--ai-soft);
    color: var(--ai-ink);

    & svg {
        width: 12px;
        height: 12px;
    }
}

.cb-badge--review {
    background: var(--warning-soft);
    color: var(--ink);
}

.cb-badge--validated {
    background: var(--success-soft);
    color: var(--success);
}

.cb-badge--delivered {
    background: var(--brand-soft);
    color: var(--brand);
}

.cb-badge--refused {
    background: var(--danger-soft);
    color: var(--danger);
}

.cb-badge--neutral {
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

/* Version chip */
.cb-version {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 28px;
    padding: 0 var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-raised);
    color: var(--ink);
    font: 500 13px/20px var(--font);
    font-variant-numeric: tabular-nums;
}

.cb-version--current {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
}

.cb-version__meta {
    color: var(--ink-muted);
}

/* Annotation canvas, pin and bubble */
.cb-canvas {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 3 / 2;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    overflow: hidden;
}

/* A pin: a teardrop whose tip points at its spot, its label upright in it */
.cb-pin {
    position: absolute;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--surface-raised);
    border-radius: var(--radius-round) var(--radius-round) var(--radius-round) 0;
    background: var(--info);
    box-shadow: var(--shadow-sm);
    color: var(--surface-raised);
    font: 600 11px/16px var(--font);
    transform: translate(-50%, calc(-50% - 20px)) rotate(-45deg);

    & > .cb-pin__label {
        display: grid;
        place-items: center;
        transform: rotate(45deg);
    }

    &.is-active,
    &.cb-pin--compared {
        z-index: 1;
        box-shadow: 0 0 0 4px var(--info-soft), var(--shadow-sm);
    }

    /* The compared comment on the version shown: its place on its own version. A full pin, so it reads on any
       visual (a pale one hid a white pin), its edge dashed and ringed to say it comes from a version before. */
    &.cb-pin--earlier {
        border: 2px dashed var(--surface-raised);
        background: var(--info);
        color: var(--surface-raised);
        box-shadow: 0 0 0 2px var(--info), 0 0 0 6px var(--info-soft), var(--shadow-sm);
    }
}

/* The switch of a compared version: the pages of the other version hide, without script. The radios of Tabler hide
   with display: none; these stay in the keyboard order, out of sight. */
.cb-compare__switch {
    position: relative;
    margin-inline-start: auto;

    & > .nav-link-input {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    & > .nav-link-input:focus-visible + .nav-link {
        outline: 2px solid var(--brand);
        outline-offset: 1px;
    }
}

.cb-compare__version {
    display: contents;
}

.cb-viewer:has(#compare-earlier:checked) .cb-compare__version--current,
.cb-viewer:has(#compare-current:checked) .cb-compare__version--earlier {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .cb-pin {
        transition: box-shadow 150ms;
    }
}

.cb-pin--done {
    background: var(--success);
}

.cb-pin--ai {
    background: var(--ai);
    color: var(--on-ai);
}

.cb-bubble {
    position: absolute;
    max-width: 240px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
    box-shadow: var(--shadow-md);
    font: 400 13px/20px var(--font);
}

.cb-bubble__meta {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-muted);
    font: 500 11px/16px var(--font);
}

/* Deliverable card */
.cb-card {
    width: 100%;
    max-width: 320px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cb-card__preview {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    background: var(--surface-sunken);
    color: var(--ink-faint);
    font: 500 13px/20px var(--font);
}

.cb-card__body {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
}

.cb-card__title {
    margin: 0;
    font: 600 17px/24px var(--font);
}

.cb-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

/* A line of meta: pieces (spans), each its own translated text, with the dot between them drawn here so that no sentence has to join them.
   A piece never breaks inside, and the dot ends the piece before it: when the line wraps, the dot stays at the end of the line it
   separates and never opens the next one. A piece longer than the line (a client name of 150 characters) ends in an ellipsis
   instead of pushing the page sideways. */
.cb-meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--space-2);
    min-width: 0;

    & > * {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    & > :not(:last-child)::after {
        content: '·';
        content: '·' / '';
        margin-inline-start: var(--space-2);
    }
}

/*
 * A meta line that wraps (the address and the last visit of a person): each piece draws its dot before itself, in a
 * margin the line lends on its start side. The piece that opens a line has its dot in that margin, which the clip hides,
 * so a line never ends on a dot alone nor starts with one.
 */
.cb-meta--wrap {
    column-gap: 0;
    margin-inline-start: calc(-1 * var(--space-4));
    clip-path: inset(0 0 0 var(--space-4));

    & > :not(:last-child)::after {
        content: none;
    }

    & > ::before {
        content: '·';
        content: '·' / '';
        display: inline-block;
        width: var(--space-4);
        text-align: center;
    }
}

/*
 * Thumbnail of a file of a library: the image itself (up to 2 MB, Asset::hasPreview()) or a tile with its extension.
 * sm is a 40px square, md fills its column at 4:3 (the board of a library), lg is a 120px square.
 * The image is contained, never cropped: a logo keeps its whole shape on the sunken background.
 */
.cb-thumb {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

.cb-thumb--sm {
    width: 40px;
    aspect-ratio: 1;
}

.cb-thumb--md {
    width: 100%;
    aspect-ratio: 4 / 3;
}

.cb-thumb--lg {
    width: 120px;
    aspect-ratio: 1;
}

.cb-thumb__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: var(--space-1);
    object-fit: contain;
}

.cb-thumb__label {
    max-width: 100%;
    padding-inline: 2px;
    overflow: hidden;
    font: 500 10px/16px var(--font);
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-thumb__disc {
    display: grid;
    place-items: center;
    width: 60%;
    max-width: 36px;
    aspect-ratio: 1;
    border-radius: var(--radius-round);
    background: var(--ai);
    color: var(--on-ai);

    & svg {
        width: 55%;
        height: 55%;
    }
}

.cb-thumb--md .cb-thumb__label {
    padding-inline: var(--space-1);
    font-size: 13px;
}

.cb-thumb--lg .cb-thumb__label {
    padding-inline: var(--space-1);
    font-size: 14px;
}

/*
 * Mosaic: up to four thumbnails of a library in a 2 × 2 grid, or the initial of its name on the same sunken square.
 * The square is 56px (sm) or 96px (md) whatever it holds, so a list of them lines up.
 */
.cb-mosaic {
    display: grid;
    flex: none;
    grid-template-columns: repeat(2, 1fr);
    align-content: start;
    gap: 2px;
    padding: var(--space-1);
    border-radius: var(--radius);
    background: var(--surface-sunken);

    & .cb-thumb {
        width: auto;
        border: 0;
        border-radius: var(--radius-sm);
        background: var(--surface-raised);
    }

    & .cb-thumb__label {
        padding-inline: 0;
        font-size: 7px;
        line-height: 8px;
    }
}

.cb-mosaic--sm {
    width: 56px;
    height: 56px;
}

.cb-mosaic--md {
    width: 96px;
    height: 96px;
    gap: var(--space-1);
    padding: 6px;

    & .cb-thumb__label {
        font-size: 10px;
        line-height: 12px;
    }
}

.cb-mosaic--initial {
    grid-template-columns: 1fr;
    place-items: center;
    align-content: center;
    padding: 0;
    color: var(--ink);
    font-family: var(--font);
    font-weight: 600;
    text-transform: uppercase;
}

.cb-mosaic--initial.cb-mosaic--sm {
    font-size: 24px;
    line-height: 1;
}

.cb-mosaic--initial.cb-mosaic--md {
    font-size: 40px;
    line-height: 1;
}

/*
 * Filmstrip: the deliverables of a project once its brief is validated. The production reads a grid of cards (Cb:ObjectCard, its
 * menu beside it, over the top right of the image): the extension stands large in the image zone until a version gives a
 * thumbnail, the status in a pill at its top left. The grid has three columns from 40rem of room, two from 24rem, one
 * under. The production reads them in groups by who must act. The client side reads one line per deliverable.
 */
.cb-film-section {
    container-type: inline-size;
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

/* A group of deliverables on the page of a project (« À traiter », « Chez le client », « Livrés »), and the title « Le projet » under them. */
.cb-film-group {
    display: grid;
    gap: var(--space-3);
}

.cb-film-group__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-size: 1rem;
    line-height: 1.5rem;
}

.cb-film {
    --cb-film-columns: 1;

    display: grid;
    grid-template-columns: repeat(var(--cb-film-columns), minmax(0, 1fr));
    gap: var(--space-4);
}

@container (min-width: 24rem) {
    .cb-film {
        --cb-film-columns: 2;
    }
}

@container (min-width: 40rem) {
    .cb-film {
        --cb-film-columns: 3;
    }
}

.cb-film__card {
    display: grid;

    & .cb-object__meta {
        font-family: var(--font);
        font-weight: 500;
    }

    & .cb-object__status {
        color: var(--ink-muted);
        font: 500 12px/16px var(--font);
    }
}

/* The published visual fills the 4:3 zone of a card, cropped to it: every card keeps the same shape. Out of the flow,
   or a tall image would stretch the zone (the aspect ratio of a grid is a minimum, not a size). */
.cb-film__visual {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cb-film__ext {
    color: var(--ink-muted);
    font: 500 28px/1 var(--font);
    letter-spacing: 0.04em;
}

.cb-film__status {
    padding: 2px var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    font: 600 13px/20px var(--font);
    white-space: nowrap;
}

/*
 * « À corriger », for the team: the dot of who has to act and its border tell the deliverable a client waits on from the other
 * deliverables to handle. act is never a fill (tokens.json), and the word stays next to it.
 */
.cb-act-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-inline-end: var(--space-2);
    border-radius: var(--radius-round);
    background: var(--act);
}

.cb-film__card .cb-film__status--act {
    border: 1px solid var(--act);
}

/* On the image zone of a card, the pill keeps clear of the grip and the menu at the other corner */
.cb-film__card .cb-film__status {
    position: absolute;
    top: var(--space-3);
    inset-inline-start: var(--space-3);
    max-width: calc(100% - 2 * var(--space-3) - var(--space-7) - var(--space-5));
    overflow: hidden;
    background: var(--surface-raised);
    text-overflow: ellipsis;
}

/* On a phone the status of a line goes under its name: the name and the meta keep the width */
.cb-film-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-1) var(--space-3);

    @media (max-width: 575.98px) {
        & > .cb-thumb {
            grid-row: span 2;
            align-self: start;
        }

        & > .cb-film__status {
            grid-column: 2;
            justify-self: start;
        }
    }
}

.cb-film-row__body {
    display: grid;
    min-width: 0;
}

.cb-film-row__name {
    overflow-wrap: anywhere;
    font-weight: 600;
}

.cb-film-row__meta {
    color: var(--ink-muted);
    font: 500 13px/20px var(--font);
}

/*
 * Steps of a long process (Cb:Steps): one bar per step, full with a check once passed, half full for the current step,
 * whose name stands in ink with whose turn it is after the dot of its meta. In a band narrower than 50rem (the calm
 * column of a client, a tablet) whose turn it is goes under the name, which a fifth of the band cannot hold on one line.
 * Below 576px the other steps keep their bar and leave their name to screen readers: the current step takes the room.
 */
.cb-steps {
    container-type: inline-size;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cb-steps__step {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--space-2);
    min-width: 0;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

.cb-steps__bar {
    height: 4px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--line);

    &::before {
        content: '';
        display: block;
        width: 0;
        height: 100%;
        border-radius: inherit;
        background: var(--brand);
    }
}

.cb-steps__step--done .cb-steps__bar::before {
    width: 100%;
}

.cb-steps__step--current .cb-steps__bar::before {
    width: 50%;
}

.cb-steps__label {
    display: flex;
    align-items: center;
    min-width: 0;

    & > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.cb-steps__step--done .cb-steps__label {
    gap: var(--space-1);

    & > svg {
        flex: none;
        width: 16px;
        height: 16px;
        color: var(--brand);
    }
}

.cb-steps__step--current {
    color: var(--ink);
}

.cb-steps__name {
    font-weight: 600;
}

.cb-steps__turn {
    color: var(--ink-muted);
}

@container (max-width: 50rem) {
    .cb-steps__step--current .cb-steps__label {
        flex-direction: column;
        align-items: stretch;

        & > :not(:last-child)::after {
            content: none;
        }
    }
}

@media (max-width: 575.98px) {
    .cb-steps {
        display: flex;
    }

    .cb-steps__step {
        flex: 0 0 var(--space-5);
    }

    .cb-steps__step--current {
        flex: 1 1 0;
    }

    .cb-steps__step:not(.cb-steps__step--current) .cb-steps__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

/* A card whose form is open (the brief of the team being written) takes the brand border. */
.cb-card--editing {
    border-color: var(--brand);
}

/*
 * The frame of the pages of a project (layout/project.html.twig): the summary of the project on the left, on the sunken
 * ground, the full height of the window and sticky under the banner; the header and the body of the page on the right.
 * Below the breakpoint the summary is an offcanvas of Tabler, opened by its button above the header.
 */
.cb-frame {
    @media (min-width: 992px) {
        display: grid;
        grid-template-columns: 16rem minmax(0, 1fr);
        align-items: start;
    }
}

.cb-frame__work {
    min-width: 0;
}

.cb-project-summary-toggle {
    margin: var(--space-3) var(--space-3) 0;
}

@media (min-width: 992px) {
    .cb-frame > .cb-project-summary-frame {
        position: sticky;
        top: var(--cb-env-banner-height, 0px);
        height: calc(100vh - var(--cb-env-banner-height, 0px));
        overflow-y: auto;
        border-inline-end: 1px solid var(--line);
        background: var(--surface-sunken);

        & > .offcanvas-body {
            display: block;
        }
    }
}

.cb-project-summary {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    width: 100%;
}

.cb-project-summary__project {
    margin: 0;
    padding-inline: var(--space-2);
    color: var(--ink-muted);
    font: 600 13px/20px var(--font);
    overflow-wrap: anywhere;
}

.cb-project-summary__files {
    margin: var(--space-2) 0 0;
    padding: var(--space-2) var(--space-2) 0;
    border-block-start: 1px solid var(--line);
    color: var(--ink-muted);
    font: 600 12px/16px var(--font);
}

/* The dot of who has to act, on the corner of the tile: to act in act (the color of brand), waiting in ink-muted, validated in success */
.cb-project-summary__tile {
    position: relative;
    overflow: visible;
}

.cb-project-summary__signal {
    position: absolute;
    inset-block-start: -3px;
    inset-inline-end: -3px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface-sunken);
    border-radius: var(--radius-round);
    background: var(--ink-muted);

    &[data-signal='to_act'] {
        background: var(--act);
    }

    &[data-signal='validated'] {
        background: var(--success);
    }
}

/*
 * A text written in Markdown and read in full (the brief of the team). Its headings take the size of a section heading,
 * one step under the title of the page: Tabler would draw « # » larger than that title. A level under « ### » reads as
 * strong text.
 */
.cb-markdown {
    & :is(h1, h2, h3) {
        font: 600 17px/24px var(--font);
    }

    & :is(h4, h5, h6) {
        font: 600 15px/24px var(--font);
    }
}

/*
 * A card read folded (the brief once validated, at the top of the page of a project): its title and "Éditer" on one
 * line, who validated it, then an extract of the text, cut after 5 lines until "Lire le brief" lets it run. Its headings
 * keep to the size of the text.
 */
.cb-folded {
    display: grid;
    gap: var(--space-3);
}

.cb-folded__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);

    & > .card-title {
        margin: 0;
    }
}

.cb-folded__text {
    font: 400 14px/22px var(--font);

    & :is(h1, h2, h3, h4, h5, h6) {
        margin-block: 0 var(--space-1);
        font: 600 15px/22px var(--font);
    }

    & > :last-child {
        margin-block-end: 0;
    }
}

/*
 * The toolbar of the Markdown editor (the brief of the team): a band on the sunken ground, joined to the top of its
 * field, so the buttons and the text read as one tool.
 */
.cb-md-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: var(--space-1);
    border: 1px solid var(--line-strong);
    border-bottom-color: var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface-sunken);

    & + * > textarea.form-control {
        border-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
}

/* Who validated the brief, in a green pill (the words carry the state, the colour only marks it), then the date as meta */
.cb-validated-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

.cb-validated {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 100%;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--success-soft);
    color: var(--success);
    font-weight: 600;

    /* Size only: the stroke comes from .icon */
    & svg {
        flex: none;
        width: 12px;
        height: 12px;
    }
}

.cb-workbench__work {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0;
}

/*
 * The visual of a version (templates/workspace/version/_visual.html.twig). For the team, it is the drop zone of the next
 * version: a file dragged over rings it in brand; without a draft, the whole card is the label of the file field; with
 * one, a band over it says the draft is seen by the team only, with « Remplacer ».
 */
.cb-version-visual-block {
    position: relative;

    & > .is-dragover {
        outline: 2px solid var(--brand);
        outline-offset: -2px;
        background-color: var(--brand-soft);
    }
}

/* Why « Livrer » of the header waits, under the delivery card: a lead-in, then the line in pieces of meta. */
.cb-delivery__reason {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-1);
    margin: var(--space-2) 0 0;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

/*
 * The status of a deliverable after its name: the team in grey (it waits), the client in info, a validated deliverable in success.
 * When the person who looks has to act (DeliverableStatus::signalFor()), the badge turns to a plain surface with the act
 * dot of the summary: green stays the color of what a person validated.
 */
.cb-file-status {
    margin-inline-start: var(--space-2);
    vertical-align: middle;
}

.cb-file-status--team {
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

.cb-file-status--act {
    gap: var(--space-2);
    border: 1px solid var(--line);
    background: var(--surface-raised);
    color: var(--ink);

    &::before {
        flex: none;
        width: 8px;
        height: 8px;
        border-radius: var(--radius-round);
        background: var(--act);
        content: '';
    }
}

.cb-file-status--client {
    background: var(--info-soft);
    color: var(--info);
}

.cb-file-status--validated {
    background: var(--success-soft);
    color: var(--success);
}

.cb-file-preview--drop {
    padding: var(--space-4);
    text-align: center;
    cursor: pointer;
    border-style: dashed;
    border-color: var(--line-strong);

    &:has(input:focus-visible) {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }
}

/*
 * The entries of the summary of a project (templates/workspace/project/_summary.html.twig): the project, then each deliverable
 * (the tile of its extension, its name over its status); the open page stands on
 * brand-soft with a brand border. Then the page of a deliverable (templates/workspace/deliverable.html.twig): the preview at 16:9 (the
 * extension, large, until a version gives one) and what is expected, as a list of terms, on one column under 576px.
 */
.cb-deliverable-nav {
    padding: var(--space-4) var(--space-2);

    & ul {
        display: grid;
        gap: 2px;
        margin: 0;
        padding: 0;
        list-style: none;
    }
}

.cb-deliverable-nav__entry {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: calc(var(--space-2) - 1px);
    border: 1px solid transparent;
    border-radius: var(--radius);

    &,
    &:hover,
    &:focus,
    &:active {
        color: var(--ink);
        text-decoration: none;
    }

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

    &[aria-current='page'] {
        border-color: var(--brand);
        background: var(--brand-soft);
    }
}

/* The landing still draws a declination behind a bent arrow, until the annotation PR rewrites it */
.cb-deliverable-nav__entry--declination {
    padding-inline-start: var(--space-4);
}

.cb-deliverable-nav__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--ink-muted);

    & > svg {
        width: 20px;
        height: 20px;
    }
}

.cb-deliverable-nav__icon--validated {
    background: var(--success-soft);
    color: var(--success);
}

.cb-deliverable-nav__text {
    display: grid;
    min-width: 0;
}

.cb-deliverable-nav__name {
    overflow-wrap: anywhere;
    font: 600 14px/20px var(--font);
}

.cb-deliverable-nav__status {
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);

    [aria-current='page'] > .cb-deliverable-nav__text > & {
        color: var(--brand);
    }
}

.cb-file-preview {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--space-2);
    aspect-ratio: 16 / 9;
    background: var(--surface-sunken);
}

.cb-file-preview__ext {
    color: var(--ink-muted);
    font: 500 44px/1 var(--font);
    letter-spacing: 0.04em;
}

.cb-file-preview__none {
    color: var(--ink-muted);
    font-weight: 600;
}

/*
 * The versions on the page of a deliverable: the pages of the visual in a column; the deposit, what a draft lacks, then one row
 * per role (its name, the file of the draft, its drop zone); the published versions, each file its thumbnail, role and
 * name.
 */
.cb-version-visual {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface-sunken);
}

.cb-version-visual__page {
    display: block;
    width: 100%;
    height: auto;
    background: var(--surface-raised);
}

.cb-version-files > li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

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

.cb-version-files__role {
    color: var(--ink-muted);
}

/* The page of a deliverable: the visual, then its delivery (a validated deliverable, for the team) and its comments in a side column from 992 px */
.cb-review-split {
    display: grid;
    gap: var(--space-5);
    align-items: start;

    & > * {
        min-width: 0;
    }

    @media (min-width: 992px) {
        grid-template-columns: minmax(0, 1fr) 25rem;
    }
}

.cb-review-split__side {
    display: grid;
    gap: var(--space-4);
}

/* From 992 px the comments stay beside the visual: the list scrolls in its card, the form at its foot stays in reach of a new pin */
@media (min-width: 992px) {
    .cb-review-split__side:has(> .cb-comments:only-child) {
        position: sticky;
        /* Under the header of the page, which stays on top (cb-sticky-header) */
        top: calc(var(--cb-env-banner-height, 0px) + var(--cb-sticky-header-height, 0px) + var(--space-4));
    }

    .cb-review-split__side > .cb-comments:only-child .cb-comments__body {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/*
 * The visual in large (visual_viewer_controller.js): the bar over it, then the pages at the width of the zoom
 * (--cb-zoom, 1 = the width of the column), centred under 100 %, scrolled in their frame above. A page and its image share
 * one box at every zoom: the image takes the whole width of its sheet, so a pin placed on it lands where the click was.
 * In full screen the block fills the screen and the pages scroll in it; a pin opens its comment in the side panel.
 */
.cb-viewer > :is(.cb-viewer__viewport, .cb-file-preview) {
    border-end-start-radius: var(--tblr-card-inner-border-radius);
    border-end-end-radius: var(--tblr-card-inner-border-radius);
}

.cb-viewer__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
}

/* The header of the visual and the header of « Commentaires », side by side, share one height: their edges line up. */
.cb-viewer__bar,
.cb-comments > .card-header {
    min-height: 3.5rem;
    padding-block: var(--space-2);
}

/* After the status of a draft, which takes the free space, the switch of a compared version follows it. */
.cb-viewer__status + .cb-compare__switch {
    margin-inline-start: 0;
}

/* The status of a draft at the end of the bar: the pill « Brouillon », then why sending waits, cut by an ellipsis. */
.cb-viewer__status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    margin-inline-start: auto;
}

.cb-draft-pill {
    flex: none;
    background: var(--warning-soft);
    color: var(--ink);
}

.cb-viewer__reason {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * « Remplacer le visuel » on the top right corner of the visual of a draft: the card turns into a grid of two rows, the
 * button and the pages sharing the second, so the button stays under the bar however it wraps. Its icon alone, half
 * transparent; under the pointer or the focus it turns opaque and its label slides out; a touch screen keeps it whole.
 */
.cb-viewer:has(> .cb-version-visual__replace):not(:fullscreen) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;

    & > * {
        grid-column: 1;
    }

    & > :not(.cb-viewer__bar) {
        grid-row: 2;
    }
}

.cb-version-visual__replace {
    z-index: 1;
    align-self: start;
    justify-self: end;
    gap: 0;
    /* Clear of the corner of the image, which sits a few pixels inside the viewport */
    margin: var(--space-5);
    box-shadow: var(--shadow-sm);
    opacity: 0.72;

    & > .icon {
        margin: 0;
    }

    &:has(input:focus-visible) {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }

    &:is(:hover, :has(input:focus-visible)) {
        opacity: 1;
    }

    .cb-viewer:fullscreen > & {
        display: none;
    }
}

.cb-version-visual__replace-label {
    display: inline-block;
    overflow: hidden;
    max-width: 0;
    white-space: nowrap;
    opacity: 0;

    .cb-version-visual__replace:is(:hover, :has(input:focus-visible)) > & {
        max-width: 14rem;
        margin-inline-start: var(--space-2);
        opacity: 1;
    }
}

@media (hover: none) {
    .cb-version-visual__replace {
        opacity: 1;
    }

    .cb-version-visual__replace-label {
        max-width: none;
        margin-inline-start: var(--space-2);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-version-visual__replace {
        transition: opacity 150ms ease;
    }

    .cb-version-visual__replace-label {
        transition: max-width 200ms ease, margin-inline-start 200ms ease, opacity 150ms ease;
    }
}

.cb-viewer__zoom {
    min-width: 4.5rem;
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.cb-viewer__viewport {
    overflow: auto;

    & > .cb-version-visual {
        width: calc(var(--cb-zoom, 1) * 100%);
        margin-inline: auto;
    }
}

.cb-viewer__exit {
    display: none;
}

.cb-viewer:fullscreen {
    padding: var(--space-3);
    background: var(--surface);

    & .cb-viewer__enter {
        display: none;
    }

    & .cb-viewer__exit {
        display: inline-flex;
        align-items: center;
    }

    & .cb-pin[data-comment] {
        cursor: pointer;
    }

    & > .cb-viewer__viewport {
        flex: 1 1 auto;
        min-height: 0;
        border-radius: var(--radius);
        background: var(--surface-sunken);
    }

    /* The side panel: the comment of a pin or the composer, on the light ground of the page */
    & > .cb-viewer__panel {
        --tblr-offcanvas-width: 24rem;

        border-inline-start: 1px solid var(--line);
        box-shadow: var(--shadow-md);

        & .offcanvas-title {
            font: 600 0.9375rem/1.375rem var(--font);
        }

        & .offcanvas-header {
            border-block-end: 1px solid var(--line);
        }
    }
}

/* A page of the visual: its pins sit on it, in percentages of the page; a click places one while the version takes a comment */
.cb-version-visual__sheet {
    position: relative;

    &[data-annotate-target='surface'] {
        cursor: crosshair;
    }

    & .cb-pin {
        cursor: default;
    }
}

.cb-pin--internal {
    background: var(--ink);

    & svg {
        width: 14px;
        height: 14px;
    }
}

/* The pin of a comment being written: dashed, waiting for its text */
.cb-pin--new {
    border: 2px dashed var(--info);
    background: var(--surface-raised);
    color: var(--info);
}

/* The counters of the comments and of the columns, as chips: the warm colour of the team for what waits for an action
   (act is brand; danger says an error or a deletion), grey for the rest */
.cb-count {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.cb-count--act {
    background: var(--brand-soft);
    color: var(--brand);
}

/*
 * « Copier », an icon alone in the header of the panel: the check takes its place for two seconds once the text is
 * copied. The two wrappers leave no box (display: contents): the button lays its icon out as any icon button.
 */
.cb-copy__idle {
    display: contents;
}

.cb-copy__done {
    display: none;
}

.cb-copy.is-copied {
    color: var(--success);

    & .cb-copy__idle {
        display: none;
    }

    & .cb-copy__done {
        display: contents;
    }
}

.cb-comments__counts {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.cb-comments__body {
    display: grid;
    gap: var(--space-3);
}

/* The client's deliverable in correction: the team works, the client may still answer */
.cb-comments__note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    background: var(--info-soft);
    font-size: 0.875rem;

    & svg {
        flex: none;
        width: 1.125rem;
        height: 1.125rem;
        color: var(--info);
    }
}

/* No comment yet: an icon in a ring, then how to comment; the composer takes its place once open */
.cb-composer:not([hidden]) ~ .cb-comments__empty {
    display: none;
}

.cb-comments__empty {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-3);
    text-align: center;

    & > .btn {
        margin-block-start: var(--space-2);
    }
}

.cb-comments__ring {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-round);
    background: var(--info-soft);
    color: var(--info);

    & svg {
        width: 1.625rem;
        height: 1.625rem;
    }
}

.cb-comments__empty-title {
    margin: 0;
    font: 600 0.9375rem/1.375rem var(--font);
}

.cb-comments__empty-text {
    max-width: 18rem;
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.8125rem;
}

.cb-comments__group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);

    & > summary {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        color: var(--ink-muted);
        font-size: 0.75rem;
        font-weight: 600;
        cursor: pointer;
        list-style: none;

        &::-webkit-details-marker {
            display: none;
        }
    }

    & > .cb-thread {
        margin-block-start: var(--space-3);
    }
}

/* Every fold carries a chevron, turned once open */
.cb-chevron {
    margin-inline-start: auto;
}

details[open] > summary > .cb-chevron {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: no-preference) {
    .cb-chevron {
        transition: transform 150ms;
    }
}

.cb-comments__new {
    display: grid;
    gap: var(--space-2);
}

.cb-comments__help {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

/* The composer of a new comment, at the top of the panel: highlighted, its actions on one row */
.cb-composer {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1.5px solid var(--info);
    border-radius: var(--radius);
    background: var(--surface-raised);
    box-shadow: 0 0 0 3px var(--info-soft);
    scroll-margin-block-start: calc(var(--cb-env-banner-height, 0px) + var(--space-4));

    &[hidden] {
        display: none;
    }
}

.cb-composer__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.cb-composer__title {
    margin: 0;
    font: 600 0.9375rem/1.375rem var(--font);
}

.cb-composer__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.cb-composer__hint {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.cb-composer__actions {
    display: flex;
    gap: var(--space-1);
    margin-inline-start: auto;
}

.cb-composer__cancel,
.cb-composer__cancel:is(:hover, :focus, :active) {
    color: var(--ink-muted);
    text-decoration: none;
}

.cb-composer__cancel:hover {
    color: var(--ink);
}

/* The key of a shortcut for the platform that <html data-platform> names (assets/app.js): ⌘ on a Mac, Ctrl elsewhere */
html:not([data-platform='mac']) [data-platform-key='mac'],
html[data-platform='mac'] [data-platform-key='other'] {
    display: none;
}

.cb-kbd {
    padding: 2px 5px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: none;
    color: var(--ink-muted);
    font: 500 0.6875rem/1 var(--font);
}

/* A thread: one fold per comment, a line while closed; open, its messages as bubbles, then « Répondre… » */
.cb-thread {
    min-width: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    scroll-margin-block-start: calc(var(--cb-env-banner-height, 0px) + var(--space-4));

    &.is-active {
        border-color: var(--info);
        box-shadow: 0 0 0 3px var(--info-soft);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-thread {
        transition: border-color 150ms, box-shadow 150ms;
    }
}

/* Open, the line goes: the marker sits beside the first message, the fold button on its right */
.cb-thread[open] > .cb-thread__line {
    display: none;
}

.cb-thread__inner {
    display: grid;
    /* One column no wider than the panel: a long message wraps instead of pushing the thread out. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-3);
}

.cb-thread__first {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
    min-width: 0;

    & > .cb-msg {
        flex: 1 1 auto;
        min-width: 0;
    }

    & > .cb-msg .cb-thread__marker {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
}

.cb-thread__fold {
    flex: none;
    color: var(--ink-muted);
}

/* « Attend votre réponse » under a question of the AI, « L'IA relit ce commentaire » while it reads */
.cb-thread__waiting,
.cb-thread__working,
.cb-thread__clear {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 0 2.25rem;
    color: var(--ai-ink);
    font-size: 0.75rem;
    font-weight: 600;

    & svg {
        width: 14px;
        height: 14px;
    }
}

.cb-thread__clear {
    color: var(--success);

    &[hidden] {
        display: none;
    }
}

.cb-thread__disc {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: var(--radius-round);
    background: var(--ai);
    color: var(--on-ai);

    & svg {
        width: 12px;
        height: 12px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-thread__disc {
        animation: cb-pulse 1.4s ease-in-out infinite;
    }

    /* The question that arrives with a refresh slides in */
    .cb-reply.is-fresh {
        animation: cb-slide-in 400ms ease-out both;
    }

    @keyframes cb-slide-in {
        from {
            opacity: 0;
            transform: translateY(6px);
        }
    }
}

/* A comment of a version before: its version under its marker, so it takes no width from the comment */
.cb-thread__lead {
    display: inline-grid;
    flex: none;
    justify-items: center;
    gap: 2px;
}

.cb-thread__version {
    color: var(--ink-muted);
    font: 600 0.625rem/1 var(--font);
    text-decoration: none;
    white-space: nowrap;

    &:hover,
    &:focus,
    &:active {
        color: var(--info);
        text-decoration: none;
    }
}

.cb-thread__resolve {
    margin-inline-start: auto;
}

/* The marker of a thread: the number of its pin, a lock, a speech bubble without a pin, dashed for an earlier version */
.cb-thread__marker {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-round);
    background: var(--info);
    color: var(--surface-raised);
    font: 600 11px/1 var(--font);

    & svg {
        width: 13px;
        height: 13px;
    }
}

.cb-thread__marker--internal {
    background: var(--ink);
}

.cb-thread__marker--done {
    background: var(--success);
}


.cb-thread__marker--general {
    border: 1.5px dashed var(--line-strong);
    background: transparent;
    color: var(--ink-muted);
}

.cb-thread__marker--ai {
    border: 0;
    background: var(--ai);
    color: var(--on-ai);
}

.cb-thread__marker--earlier,
.cb-thread__marker--new {
    border: 1.5px dashed var(--info);
    background: transparent;
    color: var(--info);
}

/* A message: the avatar, then a bubble, the client's in info-soft, the team's in brand-soft, an internal one dashed */
.cb-msg {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: var(--space-2);
    align-items: start;

    & > .avatar {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.625rem;
    }
}

.cb-msg__bubble {
    display: grid;
    gap: 2px;
    position: relative;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    background: var(--info-soft);
    font-size: 0.875rem;

    .cb-msg--team > & {
        background: var(--brand-soft);
    }

    .cb-msg--internal > & {
        border: 1.5px dashed var(--line-strong);
        background: var(--surface-sunken);
    }

    /* A question of the AI: its pale background, ai on its border */
    .cb-msg--ai > & {
        border: 1px solid var(--ai);
        background: var(--ai-soft);
    }
}

/* The AI has no face: in place of the avatar, its sparkles in a disc of ai */
.cb-msg__ai {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-round);
    background: var(--ai);
    color: var(--on-ai);

    & svg {
        width: 1rem;
        height: 1rem;
    }
}

/* « D'après une mémoire », a piece of meta after « L'IA » */
.cb-msg__source {
    white-space: nowrap;

    &::before {
        content: '·';
        content: '·' / '';
        margin-inline-end: var(--space-2);
    }
}

.cb-msg__meta {
    display: flex;
    align-items: center;
    column-gap: var(--space-2);
    color: var(--ink-muted);
    font-size: 0.75rem;
}

/* The bubble of the assistant carries more meta (« intelligence artificielle », « D'après une mémoire »): in a narrow
   panel the time passes under it, the name never cut */
.cb-msg--ai .cb-msg__meta {
    flex-wrap: wrap;
}

.cb-msg__name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-msg__bubble:has(> .cb-msg__meta > .cb-thread__menu) {
    position: relative;
    padding-inline-end: 2rem;
}

.cb-thread__menu {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;

    & > .btn {
        width: 1.5rem;
        height: 1.5rem;
        min-height: 0;
        padding: 0;
    }
}

/* The time on the right of the name; what the client never reads, a lock after it */
.cb-msg__time {
    flex: none;
    margin-inline-start: auto;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cb-msg__lock {
    display: inline-flex;
    flex: none;
    color: var(--ink);

    & svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Each label over its text: the side column is too narrow for both on a line */
.cb-comment-brief__facts {
    display: grid;
    margin: 0;

    & dt {
        margin-block-start: var(--space-1);
        font-weight: 600;
    }

    & dd {
        margin: 0;
        overflow-wrap: anywhere;
    }
}

/* The text as written: escaped, its line breaks kept, a long word broken */
.cb-comment__body {
    margin: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.cb-comment__note {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.cb-thread__replies {
    display: grid;
    gap: var(--space-2);
    margin: 0 0 0 2.25rem;
    padding: 0;
    list-style: none;
}

.cb-reply {
    scroll-margin-block-start: calc(var(--cb-env-banner-height, 0px) + var(--space-4));
}

/* « Répondre… »: a field with its send button inside; the field grows while it has the focus or a text */
.cb-reply-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-inline-start: 2.25rem;
}

.cb-reply-form__field {
    display: flex;
    flex: 1 1 10rem;
    align-items: flex-end;
    gap: var(--space-2);
    min-width: 0;
    padding: 4px 4px 4px var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-raised);

    &:focus-within {
        border-color: var(--focus);
        box-shadow: 0 0 0 3px var(--info-soft);
    }
}

.cb-reply-form__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 1.75rem;
    padding: 4px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0.8125rem;
    line-height: 1.25rem;
    resize: none;

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

    &:focus,
    &:not(:placeholder-shown) {
        height: auto;
        min-height: 4rem;
    }
}

.cb-send {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);

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

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

    & svg {
        width: 1rem;
        height: 1rem;
    }
}

.cb-internal-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 0;
    margin: 0;
    font-size: 0.75rem;
}

.cb-thread__line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--ink-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    list-style: none;

    &::-webkit-details-marker {
        display: none;
    }
}

.cb-thread__excerpt {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-thread__state {
    flex: none;
}

.cb-thread__line .cb-chevron {
    flex: none;
    margin-inline-start: 0;
    color: var(--ink-faint);
}

/* The tabs of the team once the AI briefed the comments: « Brief de retouche » open by default, « Commentaires » (cb-tabs--card) */
.cb-comments__tabs .cb-tabs__tab {
    flex: 1;
    justify-content: center;
}

/* The count of a tab, in a circle: quiet for the threads, the colour of what waits for « À faire » */
.cb-comments__tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font: 600 0.6875rem/1 var(--font);
}

.cb-comments__tab-count--act {
    background: var(--brand-soft);
    color: var(--brand);
}

/* Under the tabs, no rule between them and the list they show */
.cb-comments__tabs ~ .card-body {
    border-block-start: 0;
}

.cb-comments__prepared {
    font-size: 0.75rem;
}

.cb-comments__brief {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
}

/* The composer, once open, shows the threads */
.cb-comments:has(#comments-brief:checked):not(:has(.cb-composer:not([hidden]))) :is(.cb-comments__body, .cb-comments__new),
.cb-comments:has(#comments-threads:checked) .cb-comments__brief,
.cb-comments:has(.cb-composer:not([hidden])) .cb-comments__brief {
    display: none;
}

/* A card of « À faire »: the comment in one line, what to do, the contradiction and what to ask, then its actions */
.cb-retouch {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.875rem;

    /* What conflicts and what to ask stand out, soberly: the whole card comes from the AI, not this part alone */
    & .cb-comment-brief__facts {
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius);
        background: var(--surface-sunken);

        & dt:first-child {
            margin-block-start: 0;
        }
    }
}

.cb-retouch__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.cb-retouch__quote {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-retouch__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

/* The form that edits a comment or a reply in place */
.cb-comment-form {
    display: grid;
    gap: var(--space-2);
}

.cb-comment-form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* The delivery of a validated deliverable, one row per file to deposit: the source, then each final format */
.cb-delivery-row {
    display: grid;
    gap: var(--space-2);

    & .cb-upload-rows:not(:empty) {
        margin-block: var(--space-2) 0;
    }

    & label:has(input:focus-visible) {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }
}

.cb-delivery-row__head,
.cb-delivery-row__file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.cb-delivery-row__role {
    font-weight: 600;
}

/* How many rows of the delivery still lack their file, next to its title */
.cb-badge-missing {
    margin-inline-start: var(--space-2);
    background: var(--danger-soft);
    color: var(--danger);
}

.cb-expected {
    display: grid;
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
    gap: var(--space-2) var(--space-4);
    margin: 0;

    & > dt {
        color: var(--ink-muted);
        font-weight: 400;
    }

    & > dd {
        margin: 0;
    }

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

        & > dd:not(:last-child) {
            margin-block-end: var(--space-2);
        }
    }
}

.cb-expected__mono {
    font: 500 14px/22px var(--font);
}

.cb-expected__brief {
    max-width: 60ch;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

/*
 * The request of a project (templates/workspace/brief/_request.html.twig). Its files are rows: the tile of the extension,
 * the name over the size, and, frozen, the whole row downloads. On the production side a long text is cut after 13
 * lines until "Lire toute la demande" opens it (a <details> with nothing inside: opened, it lets the text run and goes).
 * Once the brief is validated, the client reads the request folded on the sunken ground, its title and meta left of
 * "Lire".
 */
.cb-attachments:not(:first-child) {
    margin-block-start: var(--space-4);
}

.cb-attachment {
    display: flex;
    align-items: center;
    gap: var(--space-3);

    & > svg {
        flex: none;
        color: var(--ink-muted);
    }
}

.cb-attachment__body {
    display: grid;
    flex: 1;
    min-width: 0;
}

.cb-attachment__name {
    font-weight: 600;
}

.cb-clip:has(+ .cb-clip__more:not([open])) {
    max-height: 13lh;
    overflow: hidden;
}

.cb-clip.cb-clip--short:has(+ .cb-clip__more:not([open])) {
    max-height: 5lh;
}

.cb-clip__more {
    &[open] {
        display: none;
    }

    & > summary {
        display: inline;
        color: var(--brand);
        font: 600 13px/20px var(--font);
        cursor: pointer;

        &::-webkit-details-marker {
            display: none;
        }
    }
}

.cb-fold {
    border: 0;
    background: var(--surface-sunken);
    box-shadow: none;
}

.cb-fold__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--space-3);
    cursor: pointer;

    &::-webkit-details-marker {
        display: none;
    }

    & > .card-title {
        margin: 0;
    }

    & > .cb-meta {
        grid-column: 1;
        color: var(--ink-muted);
    }

    & > .cb-fold__toggle {
        grid-row: 1 / span 2;
        grid-column: 2;
        gap: var(--space-1);
    }
}

.cb-fold[open] .cb-fold__toggle > svg {
    transform: rotate(180deg);
}

/* On the side of the production: the title, who wrote and the files, then "Lire la demande" as a link under them */
.cb-fold--stacked .cb-fold__summary {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-2);

    & > .cb-fold__toggle {
        grid-row: auto;
        grid-column: 1;
        justify-self: start;
    }
}

.cb-fold__toggle--link {
    display: inline-flex;
    align-items: center;
    color: var(--brand);
    font: 600 13px/20px var(--font);
}

/* The validation of the brief in the header of its project: the button, and its reason under it while it waits. */
.cb-validate {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.cb-validate__reason {
    max-width: 20rem;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
    text-align: end;
}

/*
 * Expected deliverables of a project while its brief waits (the production only): a list of fiches, each read from top to
 * bottom. The grip, the tile of the extension, then the name and its mark, the source and the dimensions, the exports in
 * pills of mono text, the first line of the short brief; the menu on the right. A line parts two deliverables. The landing
 * still draws declinations under their principal (cb-deliverables__group, cb-deliverables__declinations), joined to the middle of its
 * tile (the stem) by a bent line, until the annotation PR rewrites it.
 */
.cb-deliverables {
    --cb-deliverables-start: var(--space-5);
    --cb-deliverables-elbow: 16px;
    --cb-deliverables-stem: calc(var(--cb-deliverables-start) + 18px + var(--space-3) + 20px);

    /* On a phone the declinations step in less: their fiche keeps room for its name */
    @media (max-width: 575.98px) {
        --cb-deliverables-start: var(--space-3);
        --cb-deliverables-elbow: var(--space-3);
    }
}

.cb-deliverables,
.cb-deliverables__declinations {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cb-deliverables__declinations {
    padding-block-end: var(--space-1);
}

.cb-deliverables__group + .cb-deliverables__group,
.cb-deliverables > .cb-deliverables__entry + .cb-deliverables__entry {
    border-top: 1px solid var(--line);
}

.cb-deliverables__entry {
    --cb-deliverables-tile: 40px;
    --cb-deliverables-pad: 14px;

    position: relative;
    display: grid;
    grid-template-columns: 18px var(--cb-deliverables-tile) minmax(0, 1fr) auto;
    align-items: start;
    column-gap: var(--space-3);
    padding: var(--cb-deliverables-pad) var(--space-3) var(--cb-deliverables-pad) var(--cb-deliverables-start);

    /* The grip is absent from a deliverable without siblings: every other child keeps its column. */
    & > .cb-grip {
        grid-column: 1;
        margin-top: calc((var(--cb-deliverables-tile) - 20px) / 2);
    }

    & > .cb-thumb {
        grid-column: 2;
        width: var(--cb-deliverables-tile);
    }

    & > .cb-deliverables__body {
        grid-column: 3;
    }

    & > .dropdown {
        grid-column: 4;
    }
}

.cb-deliverables__entry--declination {
    --cb-deliverables-tile: 32px;
    --cb-deliverables-pad: 10px;

    padding-inline-start: calc(var(--cb-deliverables-stem) + var(--cb-deliverables-elbow) + var(--space-2));

    & .cb-deliverables__name {
        font-size: 14px;
        line-height: 20px;
    }
}

.cb-deliverables__group:has(> .cb-deliverables__declinations) > .cb-deliverables__entry::after,
.cb-deliverables__entry--declination:not(:last-child)::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: var(--cb-deliverables-stem);
    border-inline-start: 1.5px solid var(--line-strong);
}

.cb-deliverables__group > .cb-deliverables__entry::after {
    top: calc(var(--cb-deliverables-pad) + var(--cb-deliverables-tile));
}

/* Down the whole height of a declination that is not the last: the elbow branches off it, with no gap at its curve */
.cb-deliverables__entry--declination:not(:last-child)::after {
    top: 0;
}

.cb-deliverables__entry--declination::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: var(--cb-deliverables-stem);
    width: var(--cb-deliverables-elbow);
    height: calc(var(--cb-deliverables-pad) + var(--cb-deliverables-tile) / 2);
    border-inline-start: 1.5px solid var(--line-strong);
    border-bottom: 1.5px solid var(--line-strong);
    border-end-start-radius: var(--radius);
}

/* Its one track never grows past the column: a long name or label wraps instead of passing under the menu */
.cb-deliverables__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    min-width: 0;

    & > .cb-meta {
        font: 400 13px/20px var(--font);
    }
}

.cb-deliverables__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.cb-deliverables__name {
    color: var(--ink);
    font: 600 15px/22px var(--font);
    overflow-wrap: anywhere;

    &,
    &:hover,
    &:focus,
    &:active {
        text-decoration: none;
    }

    &:hover,
    &:focus {
        color: var(--brand);
    }
}

.cb-deliverables__spec {
    font: 500 12px/20px var(--font);

    /* The review reads the dimensions: on a narrow fiche they wrap, never cut */
    white-space: normal;
}

/* The label of an export is what the review checks: on a narrow fiche it wraps inside its pill, never cut */
.cb-deliverables__body .cb-export > * {
    white-space: normal;
}

.cb-deliverables__brief {
    margin: 0;
    overflow: hidden;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* The bent arrow of a declination on the landing */
.cb-deliverables__branch {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--ink-muted);
}

.cb-deliverables__exports {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.cb-export {
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    font: 500 12px/16px var(--font);
}

/*
 * The grip of a deliverable that drags among its siblings (sortable_deliverables_controller.js): a hold for the mouse and the
 * finger, no control. On a fiche, in its own first column; on a card, beside the menu. The place a deliverable leaves fades while
 * it moves.
 */
.cb-grip {
    display: inline-flex;
    color: var(--ink-muted);
    font-size: 20px;
    cursor: grab;
    touch-action: none;
}

.cb-film__card .cb-object-actions__menu {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.sortable-ghost {
    opacity: 0.4;
}

/*
 * Object card: a project, a client, a library or a workspace as one link (a grid tile or a row). Nothing interactive goes
 * inside it. Hover and focus change the border and the shadow, never the text; the arrow shows with them, and stays visible
 * where nothing hovers (touch).
 */
.cb-object {
    position: relative;
    display: flex;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);

    &,
    &:hover,
    &:focus,
    &:active {
        color: var(--ink);
    }

    &:hover,
    &:focus-visible {
        border-color: var(--line-strong);
        box-shadow: var(--shadow-md);
    }
}

.cb-object__body {
    display: grid;
    flex: 1;
    align-content: start;
    gap: 2px;
    min-width: 0;
}

.cb-object__title {
    margin: 0;
    font: 600 16px/24px var(--font);
    overflow-wrap: anywhere;
}

/* The title and its badges (the flags of an account) on one line; the badges wrap under a long title */
.cb-object__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    font: 500 13px/20px var(--font);
}

.cb-object__meta {
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

.cb-object__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-block-start: var(--space-1);
    font: 500 13px/20px var(--font);
}

.cb-object__arrow {
    display: inline-grid;
    flex: none;
    place-items: center;
    color: var(--ink-muted);
    font-size: 18px;
}

.cb-object__aside {
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--space-3);
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

/* Grid: the image zone on top (4:3, sunken), the text under it, the arrow at the foot */
.cb-object--grid {
    flex-direction: column;
    overflow: hidden;

    & .cb-object__media {
        display: grid;
        place-items: center;
        aspect-ratio: 4 / 3;
        padding: var(--space-3);
        border-block-end: 1px solid var(--line);
        background: var(--surface-sunken);
    }

    /* The badge of the card (a project status) sits at the top left of the image zone */
    & .cb-object__media {
        position: relative;
    }

    & .cb-object__media-badge {
        position: absolute;
        inset-block-start: var(--space-3);
        inset-inline-start: var(--space-3);
    }

    /* A mosaic (the library of a project) fills the image zone: a 96px square would float in the middle of a wide card */
    & .cb-object__media:has(> .cb-mosaic) {
        padding: 0;
    }

    & .cb-mosaic {
        place-self: stretch;
        width: auto;
        height: auto;
        border-radius: 0;
    }

    & .cb-mosaic:not(.cb-mosaic--initial) {
        grid-template-rows: repeat(2, 1fr);

        & .cb-thumb {
            aspect-ratio: auto;
        }

        & .cb-thumb__label {
            font-size: 13px;
            line-height: 16px;
        }
    }

    /* A face (Cb:Face, 38px with its ring) sits astride the lower edge of the media; the text keeps clear of its lower half */
    & .cb-object__face {
        position: relative;
        z-index: 1;
        height: 0;
        padding-inline: calc(var(--space-4) - 3px) var(--space-2);
    }

    & .cb-object__face .cb-face {
        transform: translateY(-50%);
    }

    & .cb-object__face + .cb-object__body {
        padding-block-start: calc(var(--space-2) + 19px);
    }

    & .cb-object__body {
        padding: var(--space-3) var(--space-4) var(--space-4);
    }

    /* The arrow sits at the foot of the card: the last line keeps clear of it, whichever of the two it is */
    & .cb-object__meta,
    & .cb-object__status {
        padding-inline-end: var(--space-5);
    }

    & .cb-object__arrow {
        position: absolute;
        inset-inline-end: var(--space-4);
        bottom: var(--space-3);
    }
}

/*
 * Row: the media on the left, the text, then what the aside says. The line never wraps: in a narrow column (the libraries of a
 * client beside its projects) the text gives way, it is the media that never drops above it. The arrow leaves the flow and
 * sits in the room the right padding keeps for it, centered on the card.
 */
.cb-object--row {
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) calc(var(--space-4) + var(--space-5)) var(--space-3) var(--space-3);

    & .cb-object__media {
        display: grid;
        flex: none;
    }

    & .cb-object__body {
        flex: 1 1 0;
    }

    & .cb-object__arrow {
        position: absolute;
        inset-inline-end: var(--space-4);
        inset-block: 0;
        height: fit-content;
        margin-block: auto;
    }
}

@media (hover: hover) {
    .cb-object__arrow {
        opacity: 0;
    }

    :is(.cb-object, .cb-summary):is(:hover, :focus-visible) .cb-object__arrow {
        color: var(--brand);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-object__arrow {
        transition:
            opacity 150ms,
            transform 150ms;
    }

    @media (hover: hover) {
        .cb-object__arrow {
            transform: translateX(-4px);
        }

        :is(.cb-object, .cb-summary):is(:hover, :focus-visible) .cb-object__arrow {
            transform: translateX(0);
        }
    }
}

/*
 * An object card with its menu of actions (a workspace of the administration, a deliverable): the menu is no part of
 * the link, so it sits beside it, over the right of the card. The row keeps room for it, and the arrow moves to its left;
 * a grid card keeps it at the top right of its image.
 */
.cb-object-actions {
    position: relative;

    & > .cb-object--row {
        padding-inline-end: calc(var(--space-4) + var(--space-5) + var(--space-7));
    }

    & > .cb-object--row .cb-object__arrow {
        inset-inline-end: calc(var(--space-4) + var(--space-7));
    }
}

.cb-object-actions__menu {
    position: absolute;
    inset-inline-end: var(--space-3);
    inset-block: 0;
    height: fit-content;
    margin-block: auto;
}

.cb-object--grid + .cb-object-actions__menu {
    inset-inline-end: var(--space-2);
    inset-block: var(--space-2) auto;
    margin-block: 0;
}

/*
 * Searchable selects: Tom Select, started by symfony/ux-autocomplete, in its Bootstrap 5 theme. The theme reads the --bs-*
 * variables, which Tabler does not declare (its own carry the tblr prefix), so they are set here from the tokens. The
 * wrapper keeps the classes of the select (form-select, is-invalid), so Tabler draws the border, the chevron and the
 * state. The stylesheet of Tom Select loads after this one: each rule hangs from the wrapper to win by specificity.
 */
.ts-wrapper {
    --bs-border-color: var(--line-strong);
    --bs-border-color-translucent: var(--line);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: var(--radius);
    --bs-border-radius-lg: var(--radius);
    --bs-border-width: 1px;
    --bs-body-bg: var(--surface-raised);
    --bs-body-color: var(--ink);
    --bs-secondary-bg: var(--surface-sunken);
    --bs-tertiary-bg: var(--surface-sunken);
    --bs-box-shadow-inset: none;
    --bs-form-invalid-color: var(--danger);
    --bs-form-valid-color: var(--success);

    /* Same height as a text field (40px: 24 + 2 x 7 + 2 x 1), whatever the control holds */
    &.single {
        min-height: 40px;
    }

    & .ts-control {
        padding-block: 7px;
        color: var(--ink);
        line-height: 24px;

        & input {
            color: var(--ink);
            line-height: 24px;
        }
    }

    /* The ring of the charte (2px, offset 2px, in the focus color), not the blue glow of the theme */
    &.focus .ts-control {
        border-color: var(--brand);
        outline: 2px solid var(--focus);
        outline-offset: 2px;
        box-shadow: none;
    }

    & .ts-dropdown {
        margin-top: var(--space-1);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface-raised);
        color: var(--ink);
        box-shadow: var(--shadow-md);

        & .option,
        & .no-results {
            padding: var(--space-2) var(--space-3);
            color: var(--ink);
        }

        & .no-results {
            color: var(--ink-muted);
        }

        /* The title of a group of options (the formats of a source), small and quiet above its options */
        & .optgroup-header {
            padding: var(--space-2) var(--space-3) var(--space-1);
            background: none;
            color: var(--ink-muted);
            font-size: 12px;
            font-weight: 600;
            line-height: 16px;
        }

        & .active {
            background: var(--surface-sunken);
            color: var(--ink);
        }

        & .option.selected {
            background: var(--brand-soft);
        }

        /* What the search matched: heavier, not colored (ai belongs to the AI, and brand to the action) */
        & [data-selectable] .highlight {
            background: none;
            font-weight: 600;
        }
    }
}

/* The library list: an option is a mosaic and two lines, so the list is taller than the 200px of a plain one. */
.ts-dropdown-content.cb-library-list {
    max-height: 340px;
}

.cb-library-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cb-library-option__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.cb-library-option__name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb-library-option__meta {
    color: var(--ink-muted);
    font-size: 13px;
    line-height: 20px;
}

/* The library chosen, in the closed control: the same mosaic, smaller, then the name. */
.cb-library-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.cb-library-item .cb-mosaic {
    width: 24px;
    height: 24px;
    gap: 1px;
    padding: 2px;
    border-radius: var(--radius-sm);
}

.cb-library-item .cb-mosaic--initial {
    padding: 0;
    font-size: 13px;
}

.cb-library-item .cb-thumb {
    border-radius: 0;
}

.cb-library-item .cb-thumb__img {
    padding: 0;
}

/*
 * A searchable list of one value (Tom Select) keeps its field on the line of the value chosen: Tom Select gives the field
 * a minimum of 7rem, which sends it under a long value in a narrow column.
 */
.ts-wrapper.single.has-items .ts-control > input {
    min-width: 0;
}

/* A row of the expected exports of a deliverable: the format, the use, "Retirer", and its errors under it. */
.cb-export-row {
    margin-top: var(--space-2);
}

.cb-export-row__fields {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: center;

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

/*
 * AI banner (Cb:AiBanner), the width of its container: the pale background of the AI with ai on its border. At work,
 * the sparkles pulse in a disc of ai, and the text says what the AI works on; otherwise they stand in ai.
 */
.cb-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--ai);
    border-radius: var(--radius);
    background: var(--ai-soft);
    color: var(--ink);

    & .btn {
        flex: none;
        margin-inline-start: auto;
    }
}

.cb-banner__title {
    margin: 0;
    font: 600 15px/24px var(--font);
}

.cb-banner__text {
    margin: 0;
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

.cb-banner__mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;

    & svg {
        width: 24px;
        height: 24px;
    }
}

/* The working disc, also in the confirmation window while it waits (assets/confirm.js, until) */
.cb-banner__disc,
.cb-confirm__working {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-round);
    background: var(--ai);
    color: var(--on-ai);

    & svg {
        width: 20px;
        height: 20px;
    }
}

/* The working sparkles on one line of text: a demo being prepared, in the administration's list. */
.cb-working-line {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--ink);

    & svg {
        width: 14px;
        height: 14px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-banner__disc,
    .cb-confirm__working,
    .cb-thumb__disc,
    .cb-working-line .cb-ai-icon {
        animation: cb-pulse 1.4s ease-in-out infinite;
    }

    @keyframes cb-pulse {
        0%,
        100% {
            opacity: 0.5;
            transform: scale(0.9);
        }

        50% {
            opacity: 1;
            transform: scale(1.05);
        }
    }
}

/* "Powered by" mention. The lockup is an inline SVG in currentColor: it takes the text color, never a fixed ink. */
.cb-powered {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink-muted);
    font: 400 12px/16px var(--font);
}

.cb-powered__logo {
    display: inline-block;
    width: 84px;
    height: 18px;
    font-family: var(--font);
    fill: currentColor;
}

/* Author mark */
.cb-author {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    font: 400 13px/20px var(--font);
}

.cb-author__mark {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-round);

    /* Size only: the 1.5px stroke comes from .icon */
    & svg {
        width: 14px;
        height: 14px;
    }
}

.cb-author--client .cb-author__mark {
    background: var(--info-soft);
    color: var(--info);
}

.cb-author--team .cb-author__mark {
    background: var(--brand-soft);
    color: var(--brand);
}

/* The AI has no disc nor face: the sparkles in ai, then its name. */
.cb-author--ai .cb-author__mark {
    width: 16px;

    & svg {
        width: 16px;
        height: 16px;
    }
}

.cb-author__name {
    font-weight: 600;
}

.cb-author__meta {
    color: var(--ink-muted);
}

/*
 * Face (Cb:Face): a person in a role, the photo ringed with the surface of a card so that it can sit over an image. On hover
 * of the face, or when its card takes the keyboard focus, the name and the role slide out beside it in the same pill. A touch
 * screen never sees them: the text of the page names the person in that role.
 */
.cb-face {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 3px solid var(--surface-raised);
    border-radius: var(--radius-round);
    background: var(--surface-raised);
    color: var(--ink);

    & .avatar {
        flex: none;
    }
}

.cb-face--xs {
    border-width: 2px;
}

.cb-face__label {
    flex-wrap: nowrap;
    max-width: 0;
    overflow: hidden;
    font: 400 13px/20px var(--font);
}

.cb-face__name {
    font-weight: 600;
}

.cb-face__role {
    color: var(--ink-muted);
}

/* On a card, the name over the role: the label takes the width of the longer one, and a name too long for the card ends in an ellipsis */
.cb-face--sm .cb-face__label {
    display: grid;

    & > * {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    & .cb-face__name {
        line-height: 16px;
    }

    & .cb-face__role {
        font-size: 12px;
        line-height: 14px;
    }
}

@media (hover: hover) {
    .cb-face:hover .cb-face__label,
    .cb-object:focus-visible .cb-face__label {
        max-width: 24rem;
        padding-inline: var(--space-2);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-face__label {
        transition:
            max-width 150ms ease-out,
            padding 150ms ease-out;
    }
}

/* A mosaic with a face on its lower right corner (the page of a project): the label slides out over the header, to the right */
.cb-media-face {
    position: relative;
    display: inline-block;
    vertical-align: top;

    & > .cb-face {
        position: absolute;
        z-index: 2;
        bottom: -6px;
        left: calc(100% - 20px);
        max-width: none;
    }
}

/*
 * Drop zone of an upload (templates/upload/_dropzone.html.twig): one dashed line, in brand while files hover over the board.
 * The element of the upload controller wraps the whole board and puts is-dragover on the zone, which may sit out of view on a
 * long board; the zone also rings when its hidden file field takes the keyboard focus.
 */
.cb-dropzone {
    display: flex;
    cursor: pointer;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink-muted);
    font: 400 14px/20px var(--font);

    &.is-dragover {
        border-style: solid;
        border-color: var(--brand);
        background-color: var(--brand-soft);
    }

    &:has(input:focus-visible) {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }
}

.cb-dropzone__limit {
    color: var(--ink);
    font-weight: 600;
}

/* The progress rows of the files in flight, under the drop zone: a gap under them only when there are some */
.cb-upload-rows:not(:empty) {
    margin-block-end: var(--space-3);
}

/*
 * The drop zone of the request of a brief, right under its field: what it does in brand over where the files go, and
 * the rows of the files in flight under it. While the form is sent, it is locked (submit_lock_controller.js).
 */
.cb-dropzone__text {
    display: grid;
    min-width: 0;
}

.cb-dropzone__action {
    color: var(--brand);
    font-weight: 600;
}

.cb-dropzone.is-locked {
    border-style: solid;
    color: var(--ink-faint);
    cursor: default;

    & .cb-dropzone__action {
        color: var(--ink-faint);
    }
}

.cb-dropzone--attach ~ .cb-upload-rows:not(:empty) {
    margin-block: var(--space-3) 0;
}

/*
 * Board of a library (templates/workspace/library.html.twig): the grid of files and the column of memories.
 * The memories column follows the scroll on a large screen and falls under the grid on a small one.
 */
.cb-board__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: var(--space-3);
    padding: 0;
}

/* A file: the thumbnail on top with its menu over a corner, then the name and its line of meta. The card is no link: it holds a menu. */
.cb-file {
    min-width: 0;
    margin: 0;
    padding: var(--space-2);
    gap: var(--space-2);
}

.cb-file__media {
    position: relative;
}

.cb-file__menu {
    position: absolute;
    inset-block-start: var(--space-2);
    inset-inline-end: var(--space-2);
}

.cb-file__body {
    min-width: 0;
    padding-inline: var(--space-1);
    padding-block-end: var(--space-1);
}

.cb-file__name {
    font: 600 14px/20px var(--font);
}

.cb-file__meta {
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

.cb-memory__main {
    flex: 1;
    min-width: 0;
}

/*
 * A header that stays on top while its page scrolls (a project whose brief waits: « Valider le brief » stays in reach;
 * a deliverable: the action of the moment, Précédent and Suivant stay in reach under a tall visual).
 * From 992px only: below, the actions wrap under the title and the header would take too much of the screen.
 * Its top margin becomes padding, so the title keeps its air once stuck, and the padding under it comes out of the gap
 * above the body: nothing moves at rest. It sticks under the environment banner. A line shows under it once the page
 * has scrolled, where the browser drives an animation by the scroll; elsewhere the header only covers what passes.
 */
@media (min-width: 992px) {
    /* Two classes: Tabler sets the margin of .page-header after this sheet */
    .page-header.cb-sticky-header {
        position: sticky;
        inset-block-start: var(--cb-env-banner-height, 0px);
        z-index: 3;
        margin-block: 0 calc(var(--tblr-page-padding-y) / -2);
        padding-block: var(--tblr-page-padding-y) calc(var(--tblr-page-padding-y) / 2);
        background: var(--tblr-body-bg);
    }

    /* A link or a field that takes the focus under the header scrolls clear of it (two classes: the rule of the banner, in app.css, is more specific than one) */
    html:has(.page-header.cb-sticky-header) {
        /*
         * What sticks under the header starts below it (the panel of the comments, which adds its own gap). A little
         * under the height of the header of a deliverable, about 7.15rem: the panel keeps its place at rest.
         */
        --cb-sticky-header-height: 6.75rem;

        scroll-padding-block-start: calc(var(--cb-env-banner-height, 0px) + 8rem);
    }

    @supports (animation-timeline: scroll()) {
        .cb-sticky-header {
            animation: cb-sticky-header-line linear both;
            animation-timeline: scroll(root block);
            animation-range: 0 var(--space-2);
        }
    }
}

@keyframes cb-sticky-header-line {
    to {
        box-shadow: 0 1px 0 var(--line);
    }
}

/* The header of a library or of a project carries a menu and the brand button: on a narrow screen they drop under the title instead of squeezing it */
.page-header .row:has(.cb-add-files, .cb-validate) > .col {
    flex-basis: 16rem;
}

@media (min-width: 992px) {
    .cb-board__memories {
        position: sticky;
        /* The fixed environment banner (app.css) covers the top of the window: the column sticks under it. 0 without banner. */
        inset-block-start: calc(var(--space-4) + var(--cb-env-banner-height, 0px));
    }
}

/*
 * Options of a single choice, each with a title and one line (cb_choices_row in templates/form/theme.html.twig): the radio,
 * then the text. The option chosen takes the brand-soft background; a disabled one fades and shows its other line (the
 * reason), so a script only disables the radio. Cards sit three in a row from 576px, one under the other below; a stack
 * holds its options in one frame.
 */
.cb-choices--cards {
    display: grid;
    gap: var(--space-3);

    @media (min-width: 576px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    & .cb-choice {
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }

    & .cb-choice:has(:checked) {
        border-color: var(--brand);
    }
}

.cb-choices--stack {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);

    & .cb-choice + .cb-choice {
        border-block-start: 1px solid var(--line);
    }
}

.cb-choice {
    display: flex;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;

    & .form-check-input {
        flex: none;
        margin-block-start: 0.25em;
    }

    &:has(:checked) {
        background: var(--brand-soft);
    }

    /* A disabled option fades its radio and its title; its line, the reason, stays readable */
    &:has(:disabled) {
        cursor: not-allowed;

        & :is(.form-check-input, .cb-choice__title) {
            opacity: 0.55;
        }
    }
}

.cb-choice__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.cb-choice__title {
    font-weight: 600;
}

.cb-choice__text {
    color: var(--ink-muted);
    font: 400 13px/18px var(--font);
}

.cb-choice__text--disabled,
.cb-choice:has(:disabled) .cb-choice__text--enabled {
    display: none;
}

.cb-choice:has(:disabled) .cb-choice__text--disabled {
    display: block;
}

/* A switch in a frame the width of the form: its label at the start of the line, the switch at the end */
.cb-switch-frame {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    & .form-switch {
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        gap: var(--space-4);
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    & .form-switch .form-check-input {
        flex: none;
        float: none;
        margin: 0;
    }

    & .form-check-label {
        font-weight: 600;
    }
}

/*
 * The People page: one card per perimeter, one row per line. From 768px a row reads on one line: the person, the access in
 * a word, the menu. Below, the access goes under the name and the menu stays top right. An invitation has a dashed circle
 * with an envelope in place of a photo.
 */
.cb-person {
    --cb-person-avatar: 2rem;
    display: grid;
    grid-template: "who menu" "access ." / minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-1) var(--space-4);

    /* The menu keeps to the first line, top right, whatever the height of the row */
    & > .dropdown {
        grid-area: menu;
        align-self: start;
    }

    @media (min-width: 768px) {
        grid-template: "who access menu" / minmax(0, 1fr) 11rem auto;
    }
}

.cb-person__who {
    display: flex;
    grid-area: who;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;

    /* A long address shortens itself, never the photo */
    & > .avatar {
        flex: none;
    }
}

.cb-person__text {
    min-width: 0;
}

.cb-person__name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cb-person__meta {
    color: var(--ink-muted);
    font: 400 13px/20px var(--font);
}

.cb-person__access {
    grid-area: access;
    /* Under the name on a phone, past the avatar */
    padding-inline-start: calc(var(--cb-person-avatar) + var(--space-3));
    font-size: 14px;

    @media (min-width: 768px) {
        padding-inline-start: 0;
    }

    & .icon,
    & svg {
        width: 16px;
        height: 16px;
        vertical-align: -3px;
    }
}

.cb-invite-mark {
    --tblr-avatar-bg: transparent;
    --tblr-avatar-box-shadow: none;
    border: 1px dashed var(--line-strong);
    color: var(--ink-muted);

    & svg {
        width: 16px;
        height: 16px;
    }
}

/* An invitation that ran out: the tone of a warning, the text in ink */
.cb-badge-expired {
    background: var(--warning-soft);
    color: var(--ink);
}

/* The title of a section of the People page: the type (Client, Projet) small before the name, then the client of a project */
.cb-section-title .cb-meta {
    display: inline-flex;
    vertical-align: baseline;
}

.cb-section-client {
    color: var(--ink-muted);
    font-weight: 400;
}

.cb-section-kind {
    margin-inline-end: var(--space-1);
    color: var(--ink-muted);
    font: 500 13px/20px var(--font);
}

/*
 * A summary row of the People page (a client, a project): the whole row is the link to its own People page. Hover fills the
 * row (Tabler's list-group action) and shows the arrow of an object card.
 */
.cb-summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cb-summary__body {
    display: grid;
    flex: 1;
    min-width: 0;
}

/*
 * The access of an account on its page in the administration, grouped by workspace: the name of a workspace (or
 * "Invitations") as a quiet heading that sticks to the first of its lines.
 */
.cb-access .cb-access__workspace {
    margin: 0;
    padding-block-end: 0;
    border-block-end-width: 0;
    color: var(--ink-muted);
    font: 600 13px/20px var(--font);
}

/* The check of Valide sits on the text line, as on the People page */
.cb-access .cb-meta svg {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

/* Consent banner of www.: a card pinned to the bottom of the viewport, above the page, readable in both themes through the card tokens */
.cb-consent {
    position: fixed;
    inset-inline: var(--space-4);
    bottom: var(--space-4);
    z-index: 1030;
    max-width: 720px;
    margin-inline: auto;
    box-shadow: var(--shadow-md);
}

/* "Manage cookies" sits among the footer links as a button: drawn like them, underlined on hover like them */
.cb-consent-open {
    padding: 0;
    border: 0;
    background: none;

    &:hover {
        text-decoration: underline;
    }
}

/*
 * The confirmation window (assets/confirm.js), a dialog of the product rather than a modal of Bootstrap: 24px of room,
 * corners of --radius-lg, a soft shadow over a light veil. On top, the ring of the kind of the action and the question on one
 * row, centred on each other; under them, aligned with the question, the sentence on what follows and its extras; at
 * the bottom right, with no band, « Annuler » as a quiet text button, then the action with its icon and its label. As
 * wide as its buttons need, within 30rem; on a narrow screen « Annuler » shrinks.
 */
.cb-confirm {
    --cb-confirm-ring: var(--danger-soft);
    --cb-confirm-ring-ink: var(--danger);
    --cb-confirm-ring-size: 2.5rem;

    width: max-content;
    min-width: min(24rem, calc(100% - 2 * var(--tblr-modal-margin)));
    max-width: min(30rem, calc(100% - 2 * var(--tblr-modal-margin)));
    margin-inline: auto;

    &[data-kind='info'] {
        --cb-confirm-ring: var(--info-soft);
        --cb-confirm-ring-ink: var(--info);
    }

    &[data-kind='brand'] {
        --cb-confirm-ring: var(--brand-soft);
        --cb-confirm-ring-ink: var(--brand);
    }

    &[data-kind='warning'] {
        --cb-confirm-ring: var(--warning-soft);
        --cb-confirm-ring-ink: var(--ink);
    }

    & > .modal-content {
        display: grid;
        gap: var(--space-4);
        padding: var(--space-5);
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: var(--surface-raised);
        box-shadow: var(--shadow-md);
    }
}

/*
 * The feedback window of the frame (feedback/_dialog.html.twig), a native dialog on the measures of the confirmation
 * window: 24px of room, large corners, a soft shadow over a light veil of the ink. One text field, « Annuler » as a
 * quiet text button, then « Envoyer ». It never holds the brand button: that one belongs to the page.
 */
.cb-feedback {
    width: min(32rem, calc(100% - 2 * var(--space-4)));
    padding: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    color: var(--ink);
    box-shadow: var(--shadow-md);

    &::backdrop {
        background: color-mix(in srgb, var(--ink) 24%, transparent);
    }
}

.cb-feedback__form {
    display: grid;
    gap: var(--space-4);

    /* The thanks take its place for a moment */
    &[hidden] {
        display: none;
    }
}

.cb-feedback__title {
    margin: 0;
    font: 600 1.125rem/1.5rem var(--font);
}

.cb-feedback__note,
.cb-feedback__error,
.cb-feedback__thanks {
    margin: 0;
}

.cb-feedback__note {
    color: var(--ink-muted);
}

.cb-feedback__error {
    color: var(--danger);
}

.cb-feedback__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* The feedback of the administration, one card each: the text leads, who and the state above it, the page under it in small */
.cb-feedback-list {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cb-feedback-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
}

.cb-feedback-card__who {
    display: grid;
    flex: 1;
    min-width: 10rem;
    font: 400 13px/20px var(--font);

    & > a {
        justify-self: start;
        font-size: 14px;
    }
}

/* The state, on the right of the head: the issue, then "to handle" or who handled it */
.cb-feedback-card__state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    font: 400 13px/20px var(--font);
}

.cb-feedback-card__body {
    margin-block: var(--space-4) var(--space-3);
    color: var(--ink);
    font: 400 16px/26px var(--font);
    overflow-wrap: anywhere;
}

.cb-feedback-card__context {
    color: var(--ink-muted);
    font: 400 12px/20px var(--font);
}

/* What the team does with a feedback, at the end of the foot, on one line that wraps */
.cb-feedback-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

/* A handled feedback steps back: its text greys. Its foot stays the same, whatever the state */
.cb-feedback-card--handled .cb-feedback-card__body {
    color: var(--ink-muted);
}

/* The folded field of the address of the issue: open, it takes its own line under the buttons, at the end like them */
.cb-feedback-card__issue {
    &[open] {
        flex-basis: 100%;
        order: 1;
        text-align: end;
    }

    & > summary {
        list-style: none;

        &::-webkit-details-marker {
            display: none;
        }
    }

    & > form {
        display: inline-flex;
        flex-wrap: wrap;
        gap: var(--space-2);
        width: min(100%, 40rem);
        margin-block-start: var(--space-2);

        & > .form-control {
            flex: 1 1 16rem;
            width: auto;
        }
    }
}

/* The end of a header bar: the feedback entry, then the account menu */
.cb-header-end {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    margin-inline-start: auto;
}

/* A third button (« J'ai terminé ma relecture » when leaving): the box widens so the three hold on one line */
.modal-dialog.cb-confirm:has([data-confirm-alternative]:not([hidden])) {
    max-width: calc(100vw - 2 * var(--space-4));
}

/* The veil behind it: the ink of the tokens, light */
.modal-backdrop.cb-confirm-backdrop {
    --tblr-backdrop-bg: var(--ink);
    --tblr-backdrop-opacity: 0.24;
}

.cb-confirm__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cb-confirm__ring {
    display: grid;
    flex: none;
    place-items: center;
    width: var(--cb-confirm-ring-size);
    height: var(--cb-confirm-ring-size);
    border-radius: var(--radius-round);
    background: var(--cb-confirm-ring);
    color: var(--cb-confirm-ring-ink);

    & svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.cb-confirm__title {
    min-width: 0;
    margin: 0;
    font: 600 1.125rem/1.5rem var(--font);
}

/* Aligned with the question, under it; gone when nothing fills it */
.cb-confirm__content {
    display: grid;
    gap: var(--space-2);
    min-width: 0;
    margin-block-start: calc(-1 * var(--space-2));
    padding-inline-start: calc(var(--cb-confirm-ring-size) + var(--space-3));

    &:not(:has(> :not([hidden], template))) {
        display: none;
    }
}

.cb-confirm__text {
    margin: 0;
    color: var(--ink-muted);
}

/* The buttons hold on one line, a third (« J'ai terminé ma relecture » when leaving) widening the box; a narrow screen
   stacks them, the action on top */
.cb-confirm__actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-block-start: var(--space-1);

    & > .btn {
        margin: 0;
        white-space: nowrap;
    }

    & > .btn,
    & > .btn:is(:hover, :focus, :active) {
        text-decoration: none;
    }

    & > [hidden] {
        display: none;
    }

    & > [data-confirm-cancel] {
        min-width: 0;
        overflow: hidden;
        color: var(--ink-muted);
        text-overflow: ellipsis;
    }

    & > [data-confirm-cancel]:hover {
        color: var(--ink);
    }

    & > :is([data-confirm-accept], [data-confirm-alternative]) {
        flex-shrink: 0;
    }

    @media (width < 576px) {
        &:has(> [data-confirm-alternative]:not([hidden])) {
            flex-direction: column-reverse;
            align-items: stretch;
        }
    }
}

.cb-confirm__quote {
    margin: var(--space-1) 0 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.cb-confirm__facts {
    display: grid;
    gap: var(--space-1);
    margin: var(--space-1) 0 0;
    padding: 0;
    font-size: 0.875rem;
    list-style: none;

    & li {
        display: flex;
        align-items: center;
        gap: var(--space-2);
    }

    & svg {
        flex: none;
        width: 1rem;
        height: 1rem;
        color: var(--ink-muted);
    }
}

.cb-confirm__note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: var(--space-1) 0 0;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    background: var(--warning-soft);
    font-size: 0.875rem;

    & svg {
        flex: none;
        width: 1.125rem;
        height: 1.125rem;
    }
}

[hidden].cb-confirm__text,
[hidden].cb-confirm__quote,
[hidden].cb-confirm__facts,
[hidden].cb-confirm__note {
    display: none;
}

/*
 * The rail of the page of a deliverable (templates/workspace/deliverable/_rail.html.twig): a 64px column of tiles on the sunken ground,
 * the open one outlined in brand, the dot of who acts on each. Below 992px a horizontal strip above the header.
 */
.cb-rail {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    overflow-x: auto;
    border-block-end: 1px solid var(--line);
    background: var(--surface-sunken);

    @media (min-width: 992px) {
        position: sticky;
        top: var(--cb-env-banner-height, 0px);
        flex-direction: column;
        align-items: center;
        height: calc(100vh - var(--cb-env-banner-height, 0px));
        padding: var(--space-3) var(--space-2);
        overflow: hidden auto;
        border-block-end: 0;
        border-inline-end: 1px solid var(--line);
    }
}

.cb-rail__files {
    display: flex;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;

    @media (min-width: 992px) {
        flex-direction: column;
    }
}

.cb-rail__project,
.cb-rail__tile {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid transparent;
    border-radius: var(--radius);

    &,
    &:hover,
    &:focus,
    &:active {
        color: var(--ink);
        text-decoration: none;
    }

    &[aria-current='page'] {
        border-color: var(--brand);
    }

    &:is(a):hover {
        background: var(--surface-raised);
    }
}

.cb-rail__project {
    color: var(--ink-muted);
}

.cb-frame:has(> .cb-rail) {
    @media (min-width: 992px) {
        grid-template-columns: 4rem minmax(0, 1fr);
    }
}

/* The pretitle line of a page that sets page_nav: the breadcrumb on the left, the way to the previous and next object on
   the right (a deliverable: Précédent and Suivant). Discreet links, never buttons: they move, they change nothing. */
.cb-pretitle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-block-end: 0.25rem;
}

.cb-page-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    white-space: nowrap;

    a,
    a:hover,
    a:focus,
    a:active {
        display: inline-flex;
        align-items: center;
        gap: 0.125rem;
        color: var(--ink-muted);
        text-decoration: none;
    }

    a:hover,
    a:focus-visible {
        color: var(--ink);
    }

    .icon {
        width: 1rem;
        height: 1rem;
    }
}

/*
 * The news (templates/news/): a reading column, one section per day, the articles of a day in cards and its lines in a
 * list. The title of a day comes from the date format of the language, which starts some of them in lower case.
 */
.cb-news {
    max-width: 46rem;
}

.cb-news__day + .cb-news__day {
    margin-block-start: var(--space-6);
}

.cb-news__date {
    margin-block-end: var(--space-3);
    color: var(--ink-muted);
    font: 500 13px/20px var(--font);

    &::first-letter {
        text-transform: uppercase;
    }
}

.cb-news .cb-object + .cb-object {
    margin-block-start: var(--space-2);
}

/* The summary of an article is a sentence: it wraps, where a line of meta would be cut */
.cb-news .cb-object__meta > * {
    overflow: visible;
    white-space: normal;
}

/* The summary of an article is one sentence on several lines, not pieces: no dot, no margin for a dot the clip would cut its lines in */
.cb-news .cb-object__meta {
    margin-inline-start: 0;
    clip-path: none;

    & > ::before {
        content: none;
    }
}

/* The cover of an article: the top of a capture of the guide, where its header and its title are */
.cb-news__cover {
    width: 9.25rem;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
    object-position: top left;
}

.cb-badge-new {
    background: var(--brand-soft);
    color: var(--brand);
}

.cb-news__lines {
    margin-block: var(--space-2) 0;

    & > li {
        display: flex;
        gap: var(--space-4);
        align-items: baseline;
        justify-content: space-between;
        padding-block: var(--space-2);
    }

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

.cb-news__guide {
    display: inline-flex;
    flex: none;
    gap: var(--space-1);
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;

    &:is(:hover, :focus, :active) {
        text-decoration: none;
    }

    & .icon {
        width: 1rem;
        height: 1rem;
    }
}

/* The date of an article, in the meta of its page: the same capital as the title of a day */
.cb-news__when {
    display: inline-block;

    &::first-letter {
        text-transform: uppercase;
    }
}

/* Styleguide: the ground of the menu, to show what sits on it (the dot of an entry) */
.cb-sg-side {
    display: grid;
    gap: var(--space-2);
    width: 15rem;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface-sunken);
    color: var(--ink);

    & > span {
        display: flex;
        gap: var(--space-2);
        align-items: center;
    }
}

/* On a phone, the cover of an article leaves the width to its title and its summary */
@media (max-width: 575.98px) {
    .cb-news__cover {
        width: 4.5rem;
    }
}

/*
 * The block "Bien débuter" (onboarding/_block.html.twig): a small card fixed at the bottom right of the window, above
 * the page and under the sidebar's offcanvas, the dialogs and the toasts. Its header holds the title, the count, the
 * chevron and the cross; a thin bar says how far the person is; then the steps. A done step is a line with a full
 * mark, a step to do a details whose summary is its title, and the open one stands on the soft brand. Folded, the
 * block keeps its header and its bar.
 */
.cb-onboarding {
    position: fixed;
    inset-block-end: var(--space-4);
    inset-inline-end: var(--space-4);
    z-index: 1020;
    width: min(23rem, calc(100vw - 2 * var(--space-4)));
    max-height: calc(100vh - 2 * var(--space-4) - var(--cb-env-banner-height, 0px));
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    color: var(--ink);
    box-shadow: var(--shadow-md);
}

.cb-onboarding__header {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4);

    & form {
        display: flex;
    }
}

.cb-onboarding__title {
    flex: 1;
    margin: 0;
    font: 600 1rem/1.5rem var(--font);
}

.cb-onboarding__count {
    margin-inline-end: var(--space-1);
    color: var(--ink-muted);
    font-size: 0.8125rem;
}

.cb-onboarding__fold svg {
    transition: rotate 150ms;
}

.cb-onboarding--folded .cb-onboarding__fold svg {
    rotate: 180deg;
}

.cb-onboarding__progress {
    height: 0.1875rem;
    margin: 0 var(--space-4) var(--space-3);
    border-radius: var(--radius);
    background: var(--surface-sunken);

    & > span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: var(--brand);
        transition: inline-size 250ms ease-out;
    }
}

.cb-onboarding__steps {
    display: grid;
    gap: var(--space-1);
    margin: 0;
    padding: 0 var(--space-2) var(--space-3);
    list-style: none;
}

.cb-onboarding__step {
    font-size: 0.875rem;

    & summary {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-1) var(--space-2);
        border-radius: var(--radius);
        cursor: pointer;
        list-style: none;

        &::-webkit-details-marker {
            display: none;
        }

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

    & details[open] {
        padding-block-end: var(--space-3);
        border-radius: var(--radius);
        background: var(--brand-soft);

        & summary {
            font-weight: 600;

            &:hover {
                background: none;
            }
        }

        & .cb-onboarding__mark {
            border-color: var(--brand);
        }
    }

    & p {
        margin: 0 var(--space-3) var(--space-2) calc(var(--space-2) + 1.25rem + var(--space-3));
        color: var(--ink-muted);
        font-size: 0.8125rem;
        line-height: 1.25rem;
    }
}

.cb-onboarding__step--done {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) var(--space-2);
    color: var(--ink-muted);

    & .cb-onboarding__mark {
        border-color: var(--brand);
        background: var(--brand);
        color: var(--on-brand);
    }
}

.cb-onboarding__mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-round);
    background: var(--surface-raised);

    & svg {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* The mark of a step to do is a button: it ticks the step. A faint check shows under the pointer and at the focus */
.cb-onboarding__tick {
    padding: 0;
    color: var(--brand);
    cursor: pointer;

    & svg {
        opacity: 0;
    }

    &:hover,
    &:focus-visible {
        border-color: var(--brand);

        & svg {
            opacity: 0.6;
        }
    }
}

.cb-onboarding__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-inline: calc(var(--space-2) + 1.25rem + var(--space-3)) var(--space-3);
}

/* The way to the screen of the step, in the brand: the block is a surface of its own, and never takes .btn-primary from the page */
.cb-onboarding__go {
    --tblr-btn-bg: var(--brand);
    --tblr-btn-border-color: var(--brand);
    --tblr-btn-color: var(--on-brand);
    --tblr-btn-hover-bg: var(--brand-hover);
    --tblr-btn-hover-border-color: var(--brand-hover);
    --tblr-btn-hover-color: var(--on-brand);
    --tblr-btn-active-bg: var(--brand-hover);
    --tblr-btn-active-border-color: var(--brand-hover);
    --tblr-btn-active-color: var(--on-brand);

    gap: var(--space-2);
    font-weight: 600;
    text-decoration: none;

    &:hover,
    &:focus,
    &:active {
        text-decoration: none;
    }

    /* The arrow follows the label, as on a card: Tabler's margins are those of an icon that leads */
    &.btn svg {
        margin: 0;
    }
}

.cb-onboarding__guide {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.8125rem;
    font-weight: 500;

    & svg {
        width: 1rem;
        height: 1rem;
    }
}

.cb-onboarding__optional {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-block-start: 1px solid var(--line);
    font-size: 0.8125rem;

    & a {
        margin-inline-start: auto;
        font-weight: 500;
    }
}

/*
 * A step the person just did (onboarding_controller.js adds --fresh once): its line lights up on the soft brand and
 * fades, its mark pops and sends a ring out.
 */
.cb-onboarding__step--fresh {
    border-radius: var(--radius);
    animation: cb-onboarding-light 250ms ease-out both;

    & .cb-onboarding__mark {
        animation: cb-onboarding-pop 250ms ease-out both;
    }
}

@keyframes cb-onboarding-light {
    from {
        background: var(--brand-soft);
        color: var(--ink);
    }

    to {
        background: transparent;
    }
}

@keyframes cb-onboarding-pop {
    0% {
        scale: 0.3;
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent);
    }

    100% {
        scale: 1;
        box-shadow: 0 0 0 0.75rem transparent;
    }
}

/*
 * The five steps are done: the block says so, on the soft brand, and waits for « Terminer ». The first time the browser
 * sees it (--fresh), the mark of the end pops and eight sparks fly from it, in the colours of the tokens.
 */
.cb-onboarding__complete {
    display: grid;
    justify-items: center;
    gap: var(--space-2);
    margin: 0 var(--space-2) var(--space-3);
    padding: var(--space-4) var(--space-3);
    border-radius: var(--radius);
    background: var(--brand-soft);
    text-align: center;
}

.cb-onboarding__complete-title {
    margin: 0;
    font: 600 0.9375rem/1.375rem var(--font);
}

.cb-onboarding__burst {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-round);
    background: var(--brand);
    color: var(--on-brand);

    & svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    & i {
        position: absolute;
        width: 0.375rem;
        height: 0.375rem;
        border-radius: var(--radius-round);
        background: var(--brand);
        opacity: 0;

        &:nth-child(3n) {
            background: var(--info);
        }

        &:nth-child(3n + 1) {
            background: var(--warning);
        }
    }
}

.cb-onboarding__complete--fresh {
    animation: cb-onboarding-rise 250ms ease-out both;

    & .cb-onboarding__burst {
        animation: cb-onboarding-pop 250ms ease-out 150ms both;

        & i {
            animation: cb-onboarding-spark 250ms ease-out 250ms both;
        }
    }
}

@keyframes cb-onboarding-rise {
    from {
        opacity: 0;
        translate: 0 0.5rem;
    }
}

@keyframes cb-onboarding-spark {
    0% {
        opacity: 1;
        transform: rotate(var(--cb-spark)) translateY(-1rem) scale(1);
    }

    100% {
        opacity: 0;
        transform: rotate(var(--cb-spark)) translateY(-2.75rem) scale(0.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-onboarding__fold svg,
    .cb-onboarding__progress > span {
        transition: none;
    }

    .cb-onboarding__step--fresh,
    .cb-onboarding__step--fresh .cb-onboarding__mark,
    .cb-onboarding__complete--fresh,
    .cb-onboarding__complete--fresh .cb-onboarding__burst,
    .cb-onboarding__complete--fresh .cb-onboarding__burst i {
        animation: none;
    }
}

/* The home: « À traiter » (the list) and its columns (App\Service\Todo\Todo) */
.cb-todo__when {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cb-todo__go {
    color: var(--brand);
    font-weight: 600;
    white-space: nowrap;
}

/* Six steps side by side; under 1200 px the row scrolls inside its own box, never the page. */
.cb-columns {
    /* Its width comes from the page, never from its six columns: they scroll inside it. */
    contain: inline-size;
    display: grid;
    grid-template-columns: repeat(6, minmax(11rem, 1fr));
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
}

.cb-columns__column {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    min-height: 16rem;
    /* A fixed height, not the window: the next section of the home shows under the board and says the page goes on. */
    max-height: 32rem;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--surface-sunken);
}

.cb-columns__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font: 600 14px/20px var(--font);
}

.cb-columns__who {
    margin: 0;
    color: var(--ink-muted);
    font: 400 12px/16px var(--font);
}

/* Every column sits on the same ground, empty or not: the line « À l'équipe » carries the colour of the team */
.cb-columns__column--team .cb-columns__who {
    color: var(--brand);
    font-weight: 600;
}

/* Only the cards scroll, under the title and its count. The padding of the column moves inside the box: the scrollbar
   sits on the edge, and the shadow and the focus ring of a card are not cut.
   A column too full fades at its foot. The mask covers the bottom padding, which holds no card when the cards fit or the
   scroll reaches its end: the fade shows only while cards remain below, with no script and no scroll timeline. */
.cb-columns__cards {
    --cb-fade: 2rem;
    display: grid;
    align-content: start;
    gap: var(--space-2);
    min-height: 0;
    margin: 0 calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
    padding: var(--space-1) var(--space-3) var(--cb-fade);
    overflow-y: auto;
    /* A card that takes the focus scrolls above the fade. */
    scroll-padding-block-end: var(--cb-fade);
    /* Alpha only: the cards dissolve into the ground of their column, whatever its color. */
    mask-image: linear-gradient(black calc(100% - var(--cb-fade)), transparent);
}

.cb-columns__card,
.cb-columns__card:hover,
.cb-columns__card:focus,
.cb-columns__card:active {
    text-decoration: none;
}

.cb-columns__card {
    /* Holds its visually hidden text: an absolute box with no positioned ancestor would widen the page. */
    position: relative;
    display: grid;
    gap: var(--space-1);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
    color: var(--ink);
    transition: border-color 150ms, box-shadow 150ms;
}

.cb-columns__card:hover,
.cb-columns__card:focus-visible {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.cb-columns__card .cb-thumb {
    width: 100%;
    height: 4.5rem;
}

.cb-columns__name {
    font: 600 14px/20px var(--font);
    overflow-wrap: anywhere;
}

.cb-columns__meta {
    color: var(--ink-muted);
    font: 400 12px/18px var(--font);
}

/* The count of an entry of the sidebar (« À traiter » of Accueil, the tickets to take of Support): centred on the label,
   with room between them. */
.cb-sidebar .nav-link-title:has(> .cb-nav-count) {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
}
.cb-nav-count {
    line-height: 1;
    background: var(--act);
    color: var(--on-brand);
    font-variant-numeric: tabular-nums;
}

/* The segmented control of the home (the view: the list or the board): the current
   choice in the pair of the current entry of the menu. */
.nav.nav-segmented.cb-segmented {
    flex-wrap: nowrap;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-raised);
    box-shadow: none;
}

.nav.nav-segmented.cb-segmented .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 32px;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    box-shadow: none;
    color: var(--ink-muted);
    font: 600 14px/20px var(--font);
}

.nav.nav-segmented.cb-segmented .nav-link,
.nav.nav-segmented.cb-segmented .nav-link:hover,
.nav.nav-segmented.cb-segmented .nav-link:focus,
.nav.nav-segmented.cb-segmented .nav-link:active {
    text-decoration: none;
}

.nav.nav-segmented.cb-segmented .nav-link:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.nav.nav-segmented.cb-segmented :is(.nav-link.active, .nav-link-input:checked + .nav-link) {
    background: var(--brand-soft);
    color: var(--brand);
}

.nav.nav-segmented.cb-segmented .nav-link .icon {
    width: 18px;
    height: 18px;
    margin: 0;
}

/* The slide of a segmented control (segmented.js): the thumb lies between the ground of the control and its choices, and
   stands for the background of the current choice while it moves. */
.nav.nav-segmented {
    position: relative;
    isolation: isolate;
}

.nav-segmented > .cb-segmented-thumb {
    position: absolute;
    z-index: -1;
    border: var(--tblr-border-width) var(--tblr-border-style) var(--tblr-border-color);
    border-radius: var(--radius-sm);
    background: var(--tblr-nav-active-bg);
    pointer-events: none;
}

.nav.nav-segmented.cb-segmented > .cb-segmented-thumb {
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
}

.nav.nav-segmented:has(> .cb-segmented-thumb) > .nav-link {
    transition: color 200ms;
}

.nav.nav-segmented:has(> .cb-segmented-thumb) > :is(.nav-link.active, .nav-link-input:checked + .nav-link) {
    border-color: transparent;
    background: transparent;
}

/* In the menu that opens above the account at the foot of the desktop sidebar, the theme choice takes the whole width,
   its three choices in equal parts. */
@media (min-width: 992px) {
    .dropup .cb-theme-choice > .nav {
        flex: 1;

        > .nav-link {
            flex: 1;
            justify-content: center;
        }
    }
}

/* A narrow screen keeps the controls of the home on one line: a choice that is not the current one shows its icon
   only, its label stays for a screen reader (and in its title). */
@media (max-width: 1279.98px) {
    .nav.nav-segmented.cb-segmented .nav-link:not(.active) .cb-segmented__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .nav.nav-segmented.cb-segmented .nav-link:not(.active):has(.cb-segmented__label) {
        padding: 0 var(--space-2);
    }
}

/* On a phone, a line of « À traiter » puts its date and its gesture under its text, so the name keeps the width. */
@media (max-width: 767.98px) {
    .cb-todo .cb-object--row {
        flex-wrap: wrap;
        row-gap: var(--space-1);
    }

    .cb-todo .cb-object--row .cb-object__body {
        flex: 1 1 0;
    }

    .cb-todo .cb-object--row .cb-object__aside {
        flex-basis: 100%;
        justify-content: space-between;
        padding-inline-start: calc(40px + var(--space-4));
    }
}

/*
 * An account of the administration: one frame, the person on top (their card, without its own frame), then one line per
 * access on a sunken ground, in columns: the side, the workspace, what the access is limited to.
 */
.cb-account-group {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);

    /* The frame takes the hover and the focus of the card it wraps. */
    &:has(.cb-account:is(:hover, :focus-visible)) {
        border-color: var(--line-strong);
        box-shadow: var(--shadow-md);
    }

    & .cb-account.cb-object {
        border: 0;
        background: transparent;
        box-shadow: none;
    }
}

.cb-account__access {
    margin: 0;
    padding: 0;
    border-block-start: 1px solid var(--line);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--surface-sunken);
    list-style: none;
}

.cb-account__line {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 14rem) minmax(0, 1fr) 2rem;
    align-items: center;
    gap: var(--space-1) var(--space-4);
    padding: var(--space-2) var(--space-3);

    & + & {
        border-block-start: 1px solid var(--line);
    }
}

.cb-account__enter {
    grid-area: 1 / -2;
    margin: 0;
}

.cb-account__side {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: var(--space-1);
}

.cb-account__side--team {
    background: var(--brand-soft);
    color: var(--brand);
}

.cb-account__side--client {
    background: var(--info-soft);
    color: var(--info);
}

.cb-account__name {
    min-width: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cb-account__perimeters {
    min-width: 0;
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

.cb-account__seen {
    display: grid;
    text-align: end;
}

/* On a phone, the last sign-in goes under the person. */
@media (max-width: 575.98px) {
    .cb-account.cb-object--row {
        flex-wrap: wrap;
        row-gap: var(--space-2);

        & .cb-object__aside {
            flex-basis: 100%;
        }
    }

    .cb-account__seen {
        display: flex;
        gap: var(--space-2);
    }

    .cb-account__line {
        grid-template-columns: 6.5rem minmax(0, 1fr) 2rem;
    }

    .cb-account__perimeters {
        grid-column: 2;
    }

    .cb-account__perimeters:empty {
        display: none;
    }
}

/* The filter bar of a list (<twig:Cb:Filters>), the one way to search and filter a list: a search, « Filtrer »
   for the other fields in an offcanvas, a chip per active filter. 40 px high, like a button of the app. */
.cb-filters {
    flex: 1 1 100%;
    min-width: 0;
}

.cb-filters__row {
    display: flex;
    align-items: center;
    /* Without a search, « Filtrer » keeps the right. */
    justify-content: flex-end;
    gap: var(--space-3);
}

.cb-filters__search {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;

    & > svg {
        position: absolute;
        inset-inline-start: 14px;
        width: 1rem;
        height: 1rem;
        color: var(--ink-faint);
        pointer-events: none;
    }
}

.cb-filters__input,
.cb-filters__button {
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-raised);
    color: var(--ink);
    font-size: 0.875rem;
}

.cb-filters__input {
    width: 100%;
    padding: 0 var(--space-4) 0 40px;

    &::placeholder {
        color: var(--ink-faint);
    }

    &:focus {
        outline: 2px solid var(--focus);
        outline-offset: 1px;
    }
}

.cb-filters__button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    font-weight: 500;
    white-space: nowrap;

    /* Filters on: the pair of a current choice, never the brand fill, which stays the page's one button. */
    &.cb-filters__button--on {
        background: var(--brand-soft);
        border-color: transparent;
        color: var(--brand);
    }
}

/* The badge of a chosen row of the panel (cb-facet__count): it only shows on a button that filters. */
.cb-filters__count {
    min-width: 1.5rem;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--brand);
    font-size: 0.75rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cb-filters__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.cb-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 30px;
    padding: 0 6px 0 var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.cb-filters__chip-label {
    color: var(--ink-faint);
}

.cb-filters__chip-value {
    font-weight: 600;
}

.cb-filters__chip-remove,
.cb-filters__chip-remove:hover,
.cb-filters__chip-remove:focus,
.cb-filters__chip-remove:active {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    color: var(--ink-faint);
    text-decoration: none;
}

.cb-filters__chip-remove:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.cb-filters__clear,
.cb-filters__clear:hover,
.cb-filters__clear:focus,
.cb-filters__clear:active {
    margin-inline-start: var(--space-1);
    font-size: 0.8125rem;
    color: var(--ink-muted);
    text-decoration: none;
}

.cb-filters__clear:hover {
    color: var(--ink);
}

/* A filter that counts its results (form theme, cb_facet_row): one row per value, its check, its label, its number in a
   badge. The row chosen is on brand-soft with its check; a value at zero is greyed. */
.cb-facet {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cb-facet__option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    cursor: pointer;

    &:hover {
        background: var(--surface-sunken);
    }
    &:has(input:checked) {
        background: var(--brand-soft);
        color: var(--brand);
    }
    &:has(input:focus-visible) {
        outline: 2px solid var(--brand);
        outline-offset: 1px;
    }
    &:has(input:disabled) {
        color: var(--ink-faint);
        cursor: default;
        background: transparent;
    }
}
.cb-facet__check {
    display: inline-flex;
    width: 1rem;
    visibility: hidden;

    .cb-facet__option:has(input:checked) & {
        visibility: visible;
    }
}
.cb-facet__label {
    flex: 1;
}
.cb-facet__count {
    min-width: 1.5rem;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font-size: 0.75rem;
    text-align: center;
    font-variant-numeric: tabular-nums;

    .cb-facet__option:has(input:checked) & {
        background: var(--surface-raised);
        color: var(--brand);
    }
    .cb-facet__option:has(input:disabled) & {
        background: transparent;
        color: inherit;
    }
}

/* The thread of a ticket (support/ticket/_thread.html.twig): a conversation, the side of the reader on the right as
   in a messaging app, the other side on the left, a trace of a change centred between them. */
.cb-ticket-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.cb-ticket-thread__entry {
    max-width: min(36rem, 85%);
    align-self: flex-start;
}
.cb-ticket-thread__entry--mine {
    align-self: flex-end;

    & > .cb-msg {
        grid-template-columns: minmax(0, 1fr) 1.75rem;
    }

    & > .cb-msg > .avatar {
        order: 2;
    }
}
.cb-ticket-thread__change {
    align-self: center;
    margin: 0;
    font-size: 0.8125rem;
}

/* A fact of the side panel of a ticket with its edit button, then, once opened, its select (support ticket page). */
.cb-ticket-fact {
    & > summary {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        list-style: none;
        cursor: pointer;
    }

    & > summary::-webkit-details-marker {
        display: none;
    }

    &[open] > summary .cb-ticket-fact__edit {
        display: none;
    }

    & > form {
        display: flex;
        gap: var(--space-2);
        margin-top: var(--space-2);
    }
}
.cb-ticket-fact__label {
    min-width: 6rem;
    color: var(--ink-muted);
}
.cb-ticket-fact__value {
    flex: 1 1 auto;
    font-weight: 600;
}

/* Tabs: one choice leads to a different content (a segmented control changes how the same data shows). A choice is a
   radio button the stylesheet reads, so the arrow keys move between tabs without script, or a link to another page
   (.active or aria-current). The radios stay in the keyboard order, out of sight: Tabler's hide with display: none.
   Two variants: cb-tabs--card, the header of a card, the open tab melting into its body; cb-tabs--line, on a rule,
   to part the sections of a page. */
.cb-tabs {
    display: flex;
    position: relative;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;

    & > .cb-tabs__input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }
}

.cb-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: var(--ink-muted);
    font: 600 0.875rem/1.25rem var(--font);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 150ms, background-color 150ms, box-shadow 150ms;

    &,
    &:is(:hover, :focus, :active) {
        text-decoration: none;
    }

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

.cb-tabs__input:focus-visible + .cb-tabs__tab,
a.cb-tabs__tab:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

/* The header of a card: the tabs on the sunken ground; the open one takes the ground and the borders of the card and
   covers the rule under the row, so it melts into the body. */
.cb-tabs--card {
    padding: var(--space-2) var(--space-3) 0;
    border-block-end: 1px solid var(--line);
    background: var(--surface-sunken);

    & .cb-tabs__tab {
        margin-block-end: -1px;
        border: 1px solid transparent;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    & .cb-tabs__tab:hover {
        background: color-mix(in srgb, var(--surface-raised) 50%, transparent);
    }

    & :is(.cb-tabs__input:checked + .cb-tabs__tab, .cb-tabs__tab.active, .cb-tabs__tab[aria-current]) {
        border-color: var(--line);
        border-block-end-color: var(--surface-raised);
        background: var(--surface-raised);
        color: var(--ink);
    }
}

.card > .cb-tabs--card:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* On the page, on a rule: the open tab in ink, over a bar of brand that sits on the rule */
.cb-tabs--line {
    gap: var(--space-5);
    border-block-end: 1px solid var(--line);

    & .cb-tabs__tab {
        padding-inline: 0;
        margin-block-end: -1px;
        padding-block: var(--space-3);
        box-shadow: inset 0 -2px 0 transparent;
    }

    & .cb-tabs__tab:hover {
        box-shadow: inset 0 -2px 0 var(--line-strong);
    }

    & :is(.cb-tabs__input:checked + .cb-tabs__tab, .cb-tabs__tab.active, .cb-tabs__tab[aria-current]) {
        color: var(--ink);
        box-shadow: inset 0 -2px 0 var(--brand);
    }
}

/* The offers of the Billing page: a header (title, lead, the period as a segmented control), one card per tier, then the
   billing e-mail and the payment button. A card is the label of its radio, so the whole card chooses; the radio stays
   in the keyboard order, out of sight. The period's radio decides which price every card shows, without script. */
.cb-plans__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    margin-block: var(--space-4) var(--space-5);
    text-align: center;
}

.cb-plans__title {
    margin: 0;
    font: 700 1.75rem/2.25rem var(--font);
    letter-spacing: -0.01em;
}

.cb-plans__lead {
    max-width: 36rem;
    margin: 0 0 var(--space-2);
    color: var(--ink-muted);
}

.cb-plans__pickers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
}

/* Tabler hides the radios from the keyboard too (display: none). */
:is(.cb-plans__interval, .cb-plans__segment) .nav-link-input {
    display: block;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* The profile decides which offers show: the larger control, in the colour of an action. The period only changes their
   price: no frame around the control, a neutral ground and a thin line for the choice. */
.nav.nav-segmented.cb-plans__segment .nav-link {
    justify-content: center;
    min-height: 36px;
    padding-inline: var(--space-4);
    font-size: 16px;
}

.nav.nav-segmented.cb-plans__interval {
    border-color: transparent;
    background: transparent;
}

.nav.nav-segmented.cb-plans__interval .nav-link:hover {
    background: transparent;
}

.nav.nav-segmented.cb-plans__interval .nav-link-input:checked + .nav-link {
    color: var(--ink);
}

/* The thumb of a slide (segmented.js) stands for the ground of the choice: never both. */
.nav.nav-segmented.cb-plans__interval:not(:has(> .cb-segmented-thumb)) .nav-link-input:checked + .nav-link,
.nav.nav-segmented.cb-plans__interval > .cb-segmented-thumb {
    background: var(--surface-sunken);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

:is(.cb-plans__interval, .cb-plans__segment) .nav-link-input:focus-visible + .nav-link {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.cb-plans__saving {
    background: var(--success-soft);
    color: var(--success);
}

.cb-plans__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-4);
    margin-block-end: var(--space-5);
}

.cb-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
}

/* The tier the pricing puts forward: the brand border, and the only brand button of its segment. */
.cb-plan--highlight {
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}

/*
 * The highlight follows the visitor (ticket #273): the card under the pointer takes the brand border and button, and the
 * advised one gives up both until the pointer and the focus leave the cards. With no card under the pointer, the card that
 * holds the keyboard focus is the chosen one. Nothing moves on a touch screen. Hovering selects nothing: the click does.
 */
@media (hover: hover) {
    .cb-plan:hover,
    .cb-plans__grid:not(:has(> .cb-plan:hover)) > .cb-plan:has(:focus-visible) {
        border-color: var(--brand);
        box-shadow: 0 0 0 1px var(--brand), var(--shadow-md);

        /* An unpaid invoice keeps the one brand button of the page: « Payer la facture ». */
        & > .btn:not(.cb-plans--unpaid .btn) {
            --tblr-btn-bg: var(--brand);
            --tblr-btn-border-color: var(--brand);
            --tblr-btn-color: var(--on-brand);
            --tblr-btn-hover-bg: var(--brand-hover);
            --tblr-btn-hover-border-color: var(--brand-hover);
            --tblr-btn-hover-color: var(--on-brand);
            --tblr-btn-active-bg: var(--brand-hover);
            --tblr-btn-active-border-color: var(--brand-hover);
            --tblr-btn-active-color: var(--on-brand);
        }
    }

    .cb-plans__grid:has(> .cb-plan:hover) > .cb-plan--highlight:not(:hover),
    .cb-plans__grid:not(:has(> .cb-plan:hover)):has(:focus-visible) > .cb-plan--highlight:not(:has(:focus-visible)) {
        border-color: var(--line);
        box-shadow: var(--shadow-sm);

        /* The values Tabler gives a .btn without a variant */
        & > .btn {
            --tblr-btn-bg: var(--tblr-bg-surface);
            --tblr-btn-border-color: var(--tblr-border-color);
            --tblr-btn-color: var(--tblr-body-color);
            --tblr-btn-hover-bg: light-dark(color-mix(in oklab, var(--tblr-body-color) 6%, var(--tblr-bg-surface)), color-mix(in oklab, var(--tblr-body-color) 8%, var(--tblr-bg-surface)));
            --tblr-btn-hover-border-color: var(--tblr-border-active-color);
            --tblr-btn-hover-color: var(--tblr-body-color);
            --tblr-btn-active-bg: light-dark(color-mix(in oklab, var(--tblr-primary) 4%, var(--tblr-bg-surface)), color-mix(in oklab, var(--tblr-primary) 12%, var(--tblr-bg-surface)));
            --tblr-btn-active-border-color: var(--tblr-primary);
            --tblr-btn-active-color: var(--tblr-primary);
        }
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cb-plan {
        transition:
            border-color 150ms,
            box-shadow 150ms;
    }
}

.cb-plan__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.cb-plan__name {
    margin: 0;
    font: 700 1.25rem/1.75rem var(--font);
}

.cb-plan__badge {
    background: var(--brand);
    color: var(--on-brand);
}

.cb-plan__description {
    margin: 0;
    color: var(--ink-muted);
}

.cb-plan__limit {
    font-weight: 600;
}

.cb-plan__soon {
    background: var(--surface-sunken);
    color: var(--ink-muted);
}

.cb-plans__email {
    max-width: 28rem;
}

/* The recap before Checkout (workspace/billing_recap.html.twig): one line per amount, the total in bold. */
.cb-recap {
    max-width: 36rem;
}

.cb-recap__lines {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: var(--space-2);
    margin: 0;

    & dt {
        font-weight: 400;
        color: var(--ink-muted);
    }

    & dd {
        margin: 0;
        padding-inline-start: var(--space-4);
        text-align: end;
        font-weight: 500;
        font-variant-numeric: tabular-nums;
    }

    & .cb-recap__total {
        padding-block-start: var(--space-2);
        border-block-start: 1px solid var(--line);
        color: var(--ink);
        font-weight: 700;
    }
}

.cb-plan__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
    margin-block: var(--space-2);
}

.cb-plan__amount {
    font: 700 2.25rem/2.75rem var(--font);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.cb-plan__per {
    color: var(--ink-muted);
}

.cb-plan__note {
    flex-basis: 100%;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

/* The cards of the segment picked, and of it only. */
.cb-plans:has(.cb-plans__segment .nav-link-input[value="solo"]:checked) .cb-plan--team,
.cb-plans:has(.cb-plans__segment .nav-link-input[value="team"]:checked) .cb-plan--solo {
    display: none;
}

/* The monthly prices by default; the yearly ones once the period says so. A badge may belong to one period too. */
:is(.cb-plan__price--year, .cb-plan__badge--year),
.cb-plans:has(.cb-plans__interval .nav-link-input[value="year"]:checked) :is(.cb-plan__price--month, .cb-plan__badge--month) {
    display: none;
}

.cb-plans:has(.cb-plans__interval .nav-link-input[value="year"]:checked) .cb-plan__badge--year {
    display: inline-flex;
}

.cb-plans:has(.cb-plans__interval .nav-link-input[value="year"]:checked) .cb-plan__price--year {
    display: flex;
}

.cb-plan__features {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    padding: var(--space-3) 0 0;
    border-block-start: 1px solid var(--line);
    list-style: none;

    & li {
        position: relative;
        padding-inline-start: var(--space-4);
    }

    & li::before {
        content: "—";
        position: absolute;
        inset-inline-start: 0;
        color: var(--brand);
    }
}

/* Referral, announced in the tabs of the Billing page: no link, a badge. */
.cb-tabs__tab--soon {
    cursor: default;
    opacity: 0.7;

    &:hover {
        color: var(--ink-muted);
        box-shadow: none;
    }

    & .badge {
        background: var(--surface-sunken);
        color: var(--ink-muted);
    }
}

/* The billing banner (layout/_billing_banner.html.twig): a quiet row on the surface of a card, aligned on the column
   of the page, under the band of the environment. The badge carries the colour of the standing; the row stays neutral,
   except read-only, whose blocking state tints it. The rule along the bottom edge shows the share of the trial still ahead. */
.cb-billing-banner {
    --cb-billing-tone: var(--brand);
    --cb-billing-tone-soft: var(--brand-soft);
    position: relative;
    border-block-end: 1px solid var(--line);
    background: var(--surface-raised);
    color: var(--ink);
}

.cb-billing-banner--read-only,
.cb-billing-banner--past-due {
    --cb-billing-tone: var(--danger);
    --cb-billing-tone-soft: var(--danger-soft);
}

.cb-billing-banner--quota {
    --cb-billing-tone: var(--warning);
    --cb-billing-tone-soft: var(--warning-soft);
}

.cb-billing-banner--quota .cb-billing-banner__badge {
    color: var(--ink);
}

.cb-billing-banner__close {
    flex: none;
}

.cb-billing-banner--beta {
    --cb-billing-tone: var(--info);
    --cb-billing-tone-soft: var(--info-soft);
}

.cb-billing-banner--read-only {
    background: var(--danger-soft);
    border-block-end-color: color-mix(in srgb, var(--danger) 30%, var(--line));
}

.cb-billing-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-4);
    padding-block: var(--space-3);
}

.cb-billing-banner__badge {
    flex: none;
    background: var(--cb-billing-tone-soft);
    color: var(--cb-billing-tone);
    font-weight: 600;
}

/* Read-only presses harder: the badge fills. */
:is(.cb-billing-banner--read-only, .cb-billing-banner--past-due) .cb-billing-banner__badge {
    background: var(--cb-billing-tone);
    color: var(--surface-raised);
}

.cb-billing-banner__text {
    flex: 1 1 18rem;
    min-width: 0;
}

.cb-billing-banner__title {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cb-billing-banner__workspace {
    margin-inline-end: var(--space-2);
    color: var(--ink-muted);
    font-weight: 500;
}

.cb-billing-banner__line {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.cb-billing-banner__gauge {
    position: absolute;
    inset-inline-start: 0;
    inset-block-end: -1px;
    block-size: 2px;
    background: var(--cb-billing-tone);
}

.cb-billing-banner__action {
    flex: none;
    text-decoration: none;

    &:hover,
    &:focus,
    &:active {
        text-decoration: none;
    }
}

@media (max-width: 575.98px) {
    .cb-billing-banner__action {
        inline-size: 100%;
    }
}

/* The offers on a page of its own flow (the creation of a workspace): the heading and its promises on the left, the
   pickers on the right of the same row. */
.cb-plans__head--row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block: 0 var(--space-5);
    text-align: start;

    & .cb-plans__intro {
        flex: 1 1 20rem;
    }

    & .cb-plans__pickers {
        align-items: center;
        justify-content: flex-start;
    }
}

/* On a phone, the profile takes the whole width, in equal parts. */
@media (max-width: 575.98px) {
    .cb-plans__pickers,
    .nav.nav-segmented.cb-plans__segment {
        inline-size: 100%;
    }

    .cb-plans__segment > .nav-link {
        flex: 1;
    }
}

.cb-plans__heading {
    display: block;
    margin: 0 0 var(--space-2);
    font: 600 1.0625rem/1.5rem var(--font);
}

.cb-plans__promises {
    max-inline-size: none;
    margin-block: 0;
    color: var(--ink-muted);
}

/* The subscription of a workspace past its trial (workspace/_subscription.html.twig): the tier on top, its price on the
   right, what it includes under a rule; then the next invoice and the payment method side by side; then the Danger
   zone, framed in danger. */
.cb-subscription {
    display: grid;
    gap: var(--space-4);
    max-inline-size: 56rem;
}

.cb-subscription__offer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4);
    padding: var(--space-5);
}

.cb-subscription__tier {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin: 0;
    font: 700 1.5rem/2rem var(--font);
    letter-spacing: -0.01em;
}

.cb-subscription__description {
    margin: var(--space-1) 0 0;
    color: var(--ink-muted);
}

/* The tier a schedule puts in place at the end of the period, above the foot. */
.cb-subscription__upcoming {
    margin: 0;
    padding: var(--space-3) var(--space-5);
    border-block-start: 1px solid var(--line);
    background: var(--info-soft);
}

.cb-subscription__price {
    text-align: end;
}

.cb-subscription__amount {
    font: 700 1.75rem/2.25rem var(--font);
    font-variant-numeric: tabular-nums;
}

.cb-subscription__was {
    color: var(--ink-muted);
    font: 500 1.125rem/1.5rem var(--font);
}

.cb-subscription__per {
    color: var(--ink-muted);
}

.cb-subscription__discount {
    justify-content: flex-end;
    margin: var(--space-1) 0 0;
    color: var(--info);
    font-weight: 600;
}

.cb-subscription__features {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    margin: 0;
    padding: var(--space-4) 0 0;
    border-block-start: 1px solid var(--line);
    list-style: none;

    & li {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
    }

    & .icon {
        color: var(--success);
    }
}

.cb-subscription__foot,
.cb-subscription__ending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-block-start: 1px solid var(--line);
}

.cb-subscription__ending {
    justify-content: space-between;
    border-end-start-radius: var(--tblr-card-inner-border-radius);
    border-end-end-radius: var(--tblr-card-inner-border-radius);
    background: var(--warning-soft);
}

/* The tier above, once the quota of the month is reached: the band of an ending subscription, in the same colour of the system. */
.cb-subscription__next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-block-start: 1px solid var(--line);
    background: var(--warning-soft);

    & .cb-meta {
        margin: 0;
    }
}

.cb-subscription__quota {
    grid-column: 1 / -1;
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--line);
}

/*
 * The new projects of the month against the tier (workspace/_quota.html.twig): the count over the limit, and a bar that
 * takes the colour of the system from 80 %.
 */
.cb-quota {
    display: grid;
    gap: var(--space-2);
}

.cb-quota__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}

.cb-quota__title {
    font-weight: 600;
}

.cb-quota__count {
    font: 700 1.125rem/1.5rem var(--font);
    font-variant-numeric: tabular-nums;
}

.cb-quota__limit {
    color: var(--ink-muted);
    font: 500 0.875rem/1.25rem var(--font);
}

.cb-quota__bar {
    block-size: 8px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-sunken);

    & span {
        display: block;
        block-size: 100%;
        border-radius: var(--radius);
        background: var(--brand);
    }
}

.cb-quota--near .cb-quota__bar span {
    background: var(--warning);
}

.cb-quota__meta {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.8125rem;
}

/* Above the offers of a trial, and at the head of the form of a new project. */
.cb-quota-card {
    margin-block-end: var(--space-4);
}

.cb-quota-frame {
    margin-block-end: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--surface);
}

/* Under the levels of an invitation, when the solo tier is full: the first tier for a team and the way to the offers. */
.cb-team-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);

    & .cb-meta {
        margin: 0;
        color: var(--ink-muted);
        font-size: 0.875rem;
    }
}

.cb-subscription__pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-4);
}

.cb-subscription__fact {
    display: grid;
    gap: var(--space-1);
}

.cb-subscription__label {
    margin: 0;
    color: var(--ink-muted);
    font: 600 0.75rem/1rem var(--font);
}

.cb-subscription__value {
    font: 600 1.125rem/1.75rem var(--font);
    font-variant-numeric: tabular-nums;
}

.cb-subscription__danger {
    border-color: var(--danger);

    & .card-title {
        color: var(--danger);
    }
}

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

/* The creation of a workspace (account/no_workspace.html.twig): its name, as tall as the profile beside it (44px), then
   the offers, then a note. */
.cb-create-workspace__name {
    min-height: 44px;
}

.cb-create-workspace__invited {
    margin-block-start: var(--space-7);
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.875rem;
}

/* The home of a read-only workspace (workspace/paused.html.twig): one card that says why the workspace stopped, what
   waits in it, the offer it had and the one way back. The badge takes the colour of the reason, like the billing
   banner: brand after a trial, danger after a refused payment or an end, info for someone who only produces. */
.cb-paused {
    --cb-paused-tone: var(--brand);
    --cb-paused-tone-soft: var(--brand-soft);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    margin-block: var(--space-5);
    padding: var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
}

.cb-paused--payment,
.cb-paused--ended {
    --cb-paused-tone: var(--danger);
    --cb-paused-tone-soft: var(--danger-soft);
}

.cb-paused--creative {
    --cb-paused-tone: var(--info);
    --cb-paused-tone-soft: var(--info-soft);
}

.cb-paused__badge {
    background: var(--cb-paused-tone-soft);
    color: var(--cb-paused-tone);
    font-weight: 600;
}

.cb-paused__title {
    margin: 0;
    font: 700 1.75rem/2.25rem var(--font);
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.cb-paused__lead {
    margin: calc(-1 * var(--space-2)) 0 0;
    max-inline-size: 34rem;
    color: var(--ink-muted);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.cb-paused__label {
    display: block;
    margin-block-end: var(--space-1);
    color: var(--ink-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.cb-paused__waiting {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cb-paused__offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    align-self: stretch;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.cb-paused__tier {
    margin: 0;
    font-weight: 600;
}

.cb-paused__amount {
    margin-inline-start: var(--space-2);
    color: var(--ink-muted);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.cb-paused__people {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;

    & li {
        display: flex;
        align-items: center;
        gap: var(--space-2);
    }
}

.cb-paused__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-block-start: var(--space-2);

    & form {
        margin: 0;
    }

    & a,
    & a:hover,
    & a:focus,
    & a:active {
        text-decoration: none;
    }
}

.cb-paused__keep {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    align-self: stretch;
    margin: var(--space-2) 0 0;
    padding: var(--space-4) 0 0;
    border-block-start: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.875rem;
    list-style: none;

    & li {
        position: relative;
        padding-inline-start: var(--space-4);
    }

    & li::before {
        content: "—";
        position: absolute;
        inset-inline-start: 0;
        color: var(--cb-paused-tone);
    }
}

@media (max-width: 575.98px) {
    .cb-paused {
        padding: var(--space-5);
    }

    .cb-paused__actions > * {
        flex: 1 1 100%;

        & .btn {
            inline-size: 100%;
        }
    }

    .cb-paused__actions > .btn {
        inline-size: 100%;
    }
}

/* Figures of the administration (admin/_figures.html.twig): a column per month, its value on the cap, the month below. */
.cb-months {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cb-months__month {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-inline-size: 0;
    block-size: 11rem;
}

.cb-months__value {
    margin-block-end: var(--space-1);
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* The whole column, then the share of it in the accent, from the baseline. */
.cb-months__bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    inline-size: min(24px, 100%);
    block-size: calc(var(--size) * 7.5rem);
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--line-strong);

    &::after {
        content: '';
        block-size: calc(var(--part) * 100%);
        background: var(--brand);
    }
}

.cb-months--ai .cb-months__bar::after {
    background: var(--ai);
}

.cb-months__name {
    inline-size: 100%;
    padding-block-start: var(--space-1);
    border-block-start: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
}

.cb-months-legend {
    display: flex;
    gap: var(--space-3);
    color: var(--ink-muted);
    font-size: 0.8125rem;

    & span::before {
        content: '';
        display: inline-block;
        inline-size: 10px;
        block-size: 10px;
        margin-inline-end: var(--space-1);
        border-radius: var(--radius-round);
        background: var(--line-strong);
    }

    & .cb-months-legend__part::before {
        background: var(--brand);
    }
}

/* What the AI cost, ranked: a name and its cost, a bar against the first row. */
.cb-costs {
    display: grid;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.cb-costs__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}

.cb-costs__name {
    overflow: hidden;
    color: var(--ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.cb-costs__name:is(:hover, :focus) {
    color: var(--brand);
    text-decoration: none;
}

.cb-costs__cost {
    flex: none;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cb-costs__bar {
    block-size: 8px;
    margin-block: var(--space-1);
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-sunken);

    & span {
        display: block;
        block-size: 100%;
        border-radius: var(--radius);
        background: var(--ai);
    }
}

/* The AI calls of a workspace this month (Billing, Usage tab): the total on the ground of the AI, a tile per usage. */
.cb-usage {
    display: grid;
    gap: var(--space-4);
}

.cb-usage__total {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    border: 1px solid var(--ai);
    border-radius: var(--radius-lg);
    background: var(--ai-soft);
    color: var(--ink);
}

.cb-usage__disc {
    display: grid;
    place-items: center;
    inline-size: 56px;
    block-size: 56px;
    border-radius: var(--radius-round);
    background: var(--ai);
    color: var(--on-ai);

    & .icon {
        inline-size: 28px;
        block-size: 28px;
    }
}

.cb-usage__name {
    margin: 0;
    font-size: 18px;
}

.cb-usage__month {
    color: var(--ai-ink);

    &::first-letter {
        text-transform: uppercase;
    }
}

.cb-usage__figure {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.cb-usage__count {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
}

.cb-usage__purposes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

/*
 * The examples of an empty library (workspace/_library_board.html.twig): pictures, never controls. The files are
 * documents laid on a table, each tilted over its name; the memories are notes in the color of the AI, which reads them.
 */
.cb-specimens {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-around;
    gap: var(--space-5) var(--space-4);
    margin: 0;
    padding: var(--space-6) var(--space-5) var(--space-5);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    font-size: 1rem;
    list-style: none;

    /* The widths of the examples follow the font size: on a phone, two fit a row. */
    @media (max-width: 575.98px) {
        padding: var(--space-5) var(--space-3) var(--space-4);
        font-size: 0.8rem;
    }
}

.cb-specimen {
    display: grid;
    justify-items: center;
    gap: var(--space-4);
    width: var(--cb-specimen-width, 6.5rem);
}

/* The sheets of an example share one cell: the last one lies on top. */
.cb-specimen__sheets {
    display: grid;
    width: 100%;
}

.cb-specimen__sheet {
    grid-area: 1 / 1;
    align-self: end;
    overflow: hidden;
    /* A sheet of paper, not a box of the interface: it keeps the small radius. */
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm), 0 10px 16px -10px var(--overlay);
    rotate: var(--cb-specimen-tilt, 0deg);
}

.cb-specimen__name {
    color: var(--ink-muted);
    font: 600 13px/20px var(--font);
    text-align: center;
    white-space: nowrap;
}

.cb-specimen--logo {
    --cb-specimen-tilt: -4deg;
}

.cb-specimen--guide {
    --cb-specimen-width: 11em;
    --cb-specimen-tilt: 2deg;
}

.cb-specimen--fonts {
    --cb-specimen-width: 6em;
    --cb-specimen-tilt: -2deg;
}

.cb-specimen--work {
    --cb-specimen-width: 9em;
    --cb-specimen-tilt: 5deg;

    /* Two sheets: the one under shows a corner on the left. */
    & .cb-specimen__sheets {
        padding-inline: 14%;
    }

    & .cb-specimen__sheet:first-child {
        translate: -18% -10%;
        rotate: -9deg;
    }

    & .cb-specimen__sheet:last-child {
        translate: 12% 0;
    }
}

.cb-specimen--deck {
    --cb-specimen-width: 11em;
    --cb-specimen-tilt: 3deg;
}

.cb-notes {
    display: grid;
    justify-items: start;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-4) var(--space-2);
    list-style: none;
}

.cb-note {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--ai-soft);
    box-shadow: var(--shadow-sm), 0 10px 16px -10px var(--overlay);
    font: 600 14px/20px var(--font);
    rotate: -2deg;

    &:nth-child(even) {
        justify-self: end;
        rotate: 1.5deg;
    }
}

/* What the AI does with the files or the memories: its sign at the first line, then the sentence. */
.cb-ai-reads {
    display: flex;
    gap: var(--space-2);
    color: var(--ink-muted);

    & svg {
        flex: none;
        width: 16px;
        height: 16px;
        margin-block-start: 2px;
    }
}
