/*
 * App shell and screens (index.html). Components and tokens: pixs.css.
 * Desktop 1440, fluid down to 390; under 900 px the sidebar becomes a top bar
 * with a bottom-sheet menu, tables become cards and the main actions sit in a
 * fixed bar at the bottom (10-handoff-app.md §1).
 */

/* ----- Shell ----------------------------------------------------------- */

body.is-loading .app {
    visibility: hidden;
}

.app {
    display: grid;
    grid-template-columns: var(--px-sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 22px 16px 16px;
    border-right: 1px solid var(--px-border);
    background: var(--px-bg-2);
}

.brand {
    display: inline-flex;
    padding: 4px 8px;
}

/* The height sets the size of the letters, whatever the logo's width: pixs.app's are as
   tall as pixs.re's were, 112 px wide (J5.37). */
.brand img {
    display: block;
    width: auto;
    height: 31.5px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--px-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.nav__item:hover {
    background: var(--px-track);
    text-decoration: none;
}

.nav__item[aria-current="page"] {
    background: var(--px-accent-soft-2);
    color: var(--px-accent-deep);
}

.nav__item .icon {
    width: 18px;
    height: 18px;
}

.nav__soon {
    margin-left: auto;
}

.sidebar__foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.plan-card {
    padding: 16px;
    border: 1px solid var(--px-border);
    border-radius: var(--px-radius-card);
    background: var(--px-surface);
}

.plan-card a {
    font-size: 14px;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    color: var(--px-muted);
    font-size: 13px;
}

.user__email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user .btn--icon {
    width: 32px;
    min-height: 32px;
    border-color: transparent;
    background: none;
    color: var(--px-muted);
}

.user .btn--icon:hover {
    color: var(--px-ink);
}

/* ----- Workspaces (J6.16): the space selector -------------------------- */

/* The proposal of 23/11 (decisions of 27/11): the button under the logo, its menu,
   the pill of the top bar and the sheet on phones. Teams are told apart by four of
   the brand's tints, each pair at 4.5:1 or more; the personal space is a circle. */

.space-switcher {
    position: relative;
    margin-top: -8px;
}

/* The menu overlaps the main column: the sidebar (sticky, so a stacking context of
   its own) is painted above it; overlays (50) and toasts (60) stay above both. */
.sidebar {
    z-index: 30;
}

.space-badge {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-family: var(--px-font-body);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.space-badge--personal {
    border-radius: 50%;
    background: var(--px-accent-soft-2);
    color: var(--px-accent-deep);
}

.space-badge--green {
    background: var(--px-success-bg);
    color: var(--px-success);
}

.space-badge--amber {
    background: var(--px-warning-bg);
    color: var(--px-warning);
}

.space-badge--orange {
    background: var(--px-accent-soft-2);
    color: var(--px-accent-deep);
}

.space-badge--ink {
    background: var(--px-ink-2);
    color: var(--px-surface);
}

.space-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid var(--px-border-input);
    border-radius: 10px;
    background: var(--px-surface);
    color: var(--px-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.space-button:hover {
    border-color: rgba(20, 6, 0, 0.28);
}

.space-button:focus-visible {
    outline: none;
    box-shadow: var(--px-focus);
}

.space-button[aria-expanded="true"] {
    border-color: var(--px-accent);
    box-shadow: 0 0 0 3px var(--px-accent-soft-2);
}

.space-button .space-badge {
    width: 28px;
    height: 28px;
}

.space-button__text,
.space-item__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.space-button__name,
.space-item__name {
    overflow: hidden;
    color: var(--px-ink);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-button__sub,
.space-item__sub {
    overflow: hidden;
    color: var(--px-muted);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-button__chevron {
    width: 16px;
    height: 16px;
    color: var(--px-muted);
}

.space-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    width: min(336px, calc(100vw - 32px));
    padding: 6px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
    background: var(--px-surface);
    box-shadow: var(--px-shadow-modal);
}

/* From six spaces on, the list scrolls (the sixth row, cut, says so); the action stays. */
.space-menu__list {
    max-height: 308px;
    overflow-y: auto;
}

.space-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--px-ink);
    cursor: pointer;
}

.space-item:hover {
    background: var(--px-bg-2);
}

.space-item.is-current {
    background: var(--px-accent-soft);
}

.space-item:focus {
    outline: none;
    background: var(--px-accent-soft);
}

.space-item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--px-accent);
}

.space-item__count {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.space-item__number {
    color: var(--px-ink);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.space-item__unit {
    color: var(--px-muted);
    font-size: 11px;
    font-weight: 600;
}

.space-item__check {
    display: inline-flex;
    flex: none;
    width: 18px;
    color: var(--px-accent-strong);
}

.space-menu__sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--px-border);
}

.space-item--action {
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.space-item--action:hover {
    text-decoration: none;
}

.meter__payer {
    margin-bottom: -2px;
}

/* B1: where the next batch goes, and who pays. */
.space-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--px-border);
    border-radius: var(--px-radius-pill);
    background: var(--px-surface);
    color: var(--px-ink-2);
    font-size: 13px;
    text-align: left;
}

.space-line strong {
    color: var(--px-ink);
}

.space-line .space-badge {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 10px;
}

.space-line .space-badge--personal {
    border-radius: 50%;
}

/* E1 of a member in a team's space. */
.billing-team {
    border-color: var(--px-accent-line);
    background: var(--px-accent-soft);
}

.billing-team strong {
    color: var(--px-ink);
}

/* E2: the team's name, and the teams the account joined. */
.team__name {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 24px 16px;
}

.team__name .input {
    width: 260px;
}

.team__joined {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--px-border);
}

.team__spaces {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.team__space {
    flex: 1;
    min-width: 0;
}

.team__spaces .space-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
}

/* Phones: the pill of the top bar, F3's row and the sheet of the spaces. */
.topbar__space {
    display: flex;
    flex: 1;
    justify-content: flex-start;
    min-width: 0;
}

.space-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: 44px;
    padding: 0 12px 0 6px;
    border: 1px solid var(--px-border-input);
    border-radius: var(--px-radius-pill);
    background: var(--px-surface);
    color: var(--px-ink);
    font: inherit;
    cursor: pointer;
}

.space-pill:focus-visible {
    outline: none;
    box-shadow: var(--px-focus);
}

.space-pill .space-badge {
    width: 30px;
    height: 30px;
}

.space-pill__name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-pill__chevron {
    width: 16px;
    height: 16px;
    color: var(--px-muted);
}

/* Under 360 px a name would show two letters: the badge alone, the name for screen readers. */
@media (max-width: 359px) {
    .space-pill__name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

.sheet-space {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sheet-space__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 64px;
    padding: 10px 14px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
    background: var(--px-surface);
    color: var(--px-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sheet-space__row .space-item__name {
    font-size: 16px;
}

.sheet-space__row .space-item__sub {
    font-size: 13px;
}

.sheet-space__change {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 2px;
    color: var(--px-accent-text);
    font-weight: 700;
}

.space-sheet__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--px-accent-text);
}

.space-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.space-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
    background: var(--px-surface);
    cursor: pointer;
}

.space-option.is-current {
    border-color: var(--px-accent);
    background: var(--px-accent-soft);
}

.space-option:has(input:focus-visible) {
    box-shadow: var(--px-focus);
}

.space-option .space-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
}

.space-option .space-badge--personal {
    border-radius: 50%;
}

.space-option .space-item__name {
    font-size: 16px;
}

.space-option .space-item__sub {
    font-size: 13px;
}

.space-option .space-item__number {
    font-size: 15px;
}

.space-sheet__action {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding-top: 8px;
    border-top: 1px solid var(--px-border);
    color: var(--px-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.space-sheet__action .icon--sm {
    margin-left: auto;
    color: var(--px-muted);
}

.app__content {
    min-width: 0;
}

.topbar {
    display: none;
}

.main {
    min-width: 0;
    padding: var(--px-main-pad-y) var(--px-main-pad-x) 48px;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.page__titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.page__subtitle {
    color: var(--px-muted);
    font-size: 15px;
}

.page__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.crumbs {
    color: var(--px-muted);
    font-size: 14px;
    font-weight: 600;
}

.crumbs a {
    color: var(--px-ink);
    font-weight: 700;
}

.title-meta {
    margin-left: 8px;
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.row--between {
    justify-content: space-between;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    gap: 24px;
    align-items: stretch;
}

.strong {
    color: var(--px-ink);
    font-weight: 700;
}

.section-title {
    color: var(--px-ink);
    font-family: var(--px-font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.note {
    color: var(--px-muted);
    font-size: 13px;
}

.loading-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 24px;
    color: var(--px-muted);
}

.soon {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px dashed var(--px-accent-line);
    border-radius: 12px;
    background: var(--px-bg-2);
    color: var(--px-muted);
    font-size: 13px;
}

.soon .icon {
    color: var(--px-accent);
}

/* ----- B1 New batch ---------------------------------------------------- */

.dropzone--page {
    min-height: 420px;
    height: 100%;
}

/* The trial of the site's tool pages, to take over (J7.5, TrialImport.js). */

.trial {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
}

.trial__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--px-surface);
    color: var(--px-accent-strong);
}

.trial__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.trial__text {
    max-width: 70ch;
}

.trial__status {
    color: var(--px-muted);
    font-size: 14px;
}

.trial.is-warning .trial__status {
    color: var(--px-warning);
    font-weight: 600;
}

.trial__actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

/* « Choose files or a folder » and its menu (J5.35): files (images or a ZIP), or a folder. */

.pick {
    position: relative;
    display: inline-flex;
}

.pick-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 100%;
    padding: 6px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
    background: var(--px-surface);
    box-shadow: var(--px-shadow-modal);
}

.pick-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--px-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.pick-menu__item .icon {
    flex: none;
    color: var(--px-accent-strong);
}

.pick-menu__item:hover {
    background: var(--px-bg-2);
}

.pick-menu__item:focus {
    outline: none;
    background: var(--px-accent-soft);
}

.pick-menu__item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--px-accent);
}

/* « Paste image URLs » (J4.9, UrlImport.js) */

.url-import__list {
    min-height: 168px;
    white-space: pre;
    overflow-x: auto;
}

.url-import__summary {
    color: var(--px-ink);
    font-weight: 700;
}

.url-import__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.url-import__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--px-border);
    border-radius: 10px;
}

.url-import__address {
    overflow: hidden;
    color: var(--px-ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-import__reason {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--px-ink-2);
    font-size: 13px;
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
}

.settings-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* A saved preset (J5.9): its name applies it, its cross deletes it. */
.chip--saved {
    gap: 2px;
    padding: 0 4px 0 0;
    cursor: default;
}

.chip__apply {
    align-self: stretch;
    padding: 0 2px 0 12px;
    border: 0;
    border-radius: var(--px-radius-pill) 0 0 var(--px-radius-pill);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.chip__remove {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: var(--px-radius-pill);
    background: none;
    color: inherit;
    cursor: pointer;
}

.chip__remove:hover {
    background: rgba(20, 6, 0, 0.08);
}

/* « Save as preset »: the name, under the head of the settings card. */
.preset-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--px-radius-input);
    background: var(--px-bg-2);
}

.preset-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 899px) {
    /* The output format and the language a line each: « AVIF · quality 60 » is not cut. */
    .settings-card .pair {
        grid-template-columns: minmax(0, 1fr);
    }
}

.widths {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-card__facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--px-border);
    color: var(--px-ink-2);
}

.fact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fact .icon {
    color: var(--px-success);
}

.batches-table td:nth-child(n + 2) {
    white-space: nowrap;
}

.saved {
    color: var(--px-success);
    font-weight: 700;
}

.mobile-settings {
    display: none;
}

/* ----- B2 Batch -------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}

.stat__value {
    color: var(--px-ink);
    font-family: var(--px-font-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat__value small {
    margin-left: 6px;
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

.stat__sub {
    color: var(--px-muted);
    font-size: 13px;
    font-weight: 600;
}

.stat__sub--good {
    color: var(--px-success);
    font-weight: 700;
}

.stat__values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat__values span {
    padding: 6px 10px;
    border: 1px solid var(--px-border-input);
    border-radius: var(--px-radius-input);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 13px;
    font-weight: 700;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.toolbar__search {
    position: relative;
    width: min(360px, 100%);
}

.toolbar__search .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--px-muted);
    transform: translateY(-50%);
}

.toolbar__search .input {
    padding-left: 38px;
}

.toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: auto;
}

.tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--px-track);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--px-ink-2);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tab[aria-selected="true"] {
    background: var(--px-surface);
    color: var(--px-ink);
    box-shadow: 0 1px 2px rgba(20, 6, 0, 0.08);
}

.tab__count--failed {
    color: var(--px-danger);
}

.tab__count--review {
    color: var(--px-warning);
}

.tab__count--ready {
    color: var(--px-success);
}

.banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border: 1px solid #bfe5cd;
    border-radius: var(--px-radius-card);
    background: var(--px-success-bg);
    color: var(--px-success);
}

.banner__title {
    color: #14532d;
    font-size: 17px;
    font-weight: 700;
}

.banner__actions {
    margin-left: auto;
}

.banner--danger {
    border-color: #f3c4c4;
    background: var(--px-danger-bg);
    color: var(--px-danger);
}

.banner--danger .banner__title {
    color: #7f1d1d;
}

/* Images on hold for credits (J5.13, WaitingImages.js): under the batch's own banner. */
.banner + .banner {
    margin-top: 12px;
}

.banner--warning {
    border-color: #f2d9a2;
    background: var(--px-warning-bg);
    color: var(--px-warning);
}

.banner--warning .banner__title {
    color: #78350f;
}

.banner__actions.row {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* B7 « Process N » (J5.13): the batch's first images now, the others on hold. */
.credits-partial {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--px-bg);
    color: var(--px-ink-2);
    font-size: 14px;
}

.images {
    overflow: hidden;
}

.images__head,
.img-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.1fr) minmax(260px, 1.4fr) 110px 120px 130px;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
}

.images__head {
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--px-border);
    background: var(--px-bg-2);
}

.img-row {
    border-bottom: 1px solid var(--px-border);
    cursor: pointer;
}

.img-row:last-child {
    border-bottom: 0;
}

.img-row:hover {
    background: var(--px-bg-2);
}

.img-row.is-review {
    background: var(--px-warning-row);
}

.img-row.is-failed {
    background: var(--px-danger-row);
}

/* Rows ticked (J5.26, BatchSelection.js): a box per row and one in the head, once
   the batch ended; none on phones (.desktop-only). */
.images__head-first {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.select-box {
    display: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--px-accent-strong);
    cursor: pointer;
}

.images.is-selectable .select-box {
    display: block;
}

.selection-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--px-ink-2);
    font-size: 14px;
    font-weight: 600;
}

.img-row__original {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.thumb {
    display: grid;
    flex: none;
    place-items: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--px-track);
    color: var(--px-muted);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb--failed {
    background: var(--px-danger-bg);
    color: var(--px-danger);
}

.thumb--alpha {
    background-color: #fff;
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    background-size: 12px 12px;
}

.img-row__names {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.filename {
    overflow: hidden;
    color: var(--px-ink-2);
    font-family: var(--px-font-mono);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filename.is-replaced {
    color: var(--px-muted);
    text-decoration: line-through;
}

.dims {
    color: var(--px-muted);
    font-size: 13px;
}

.newname {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.newname__slug {
    overflow: hidden;
    padding: 8px 12px;
    border: 1px solid var(--px-border-input);
    border-radius: var(--px-radius-input);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.newname__alt {
    overflow: hidden;
    padding: 8px 12px;
    border: 1px solid var(--px-border-input);
    border-radius: var(--px-radius-input);
    color: var(--px-ink-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Why an image is to review (J3.5), under its name (11-BatchDone.png). */
.newname__review {
    color: var(--px-warning);
    font-size: 13px;
    font-weight: 700;
}

.skeleton {
    height: 36px;
    border-radius: var(--px-radius-input);
    background: var(--px-track);
}

.skeleton--short {
    width: 60%;
}

.problem__title {
    color: var(--px-danger);
    font-weight: 700;
}

.problem__text {
    color: var(--px-ink-2);
    font-size: 13px;
}

/* An image on hold for credits, or lapsed (J5.13): not a failure. */
.problem__title--hold {
    color: var(--px-warning);
}

.size {
    display: flex;
    flex-direction: column;
    color: var(--px-muted);
    font-size: 13px;
}

.size strong {
    color: var(--px-ink);
    font-size: 15px;
}

.images__empty {
    padding: 32px 24px;
    color: var(--px-muted);
    text-align: center;
}

.bottom-bar {
    display: none;
}

/* ----- B3 Image drawer ------------------------------------------------- */

.drawer__title {
    color: var(--px-ink);
    font-size: 17px;
    font-weight: 700;
}

.drawer__nav {
    display: flex;
    gap: 8px;
}

.preview {
    display: grid;
    place-items: center;
    min-height: 220px;
    max-height: 320px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--px-track);
    color: var(--px-muted);
}

.preview img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.preview__note {
    padding: 24px;
    text-align: center;
}

.drawer__facts {
    color: var(--px-muted);
    font-size: 13px;
    text-align: right;
}

.drawer__facts strong {
    color: var(--px-ink);
}

.input-suffix {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-suffix span {
    color: var(--px-muted);
    font-family: var(--px-font-mono);
    font-size: 13px;
}

/* A field written by hand (J5.4): small, so its label lines up with its neighbours. */
.pill--edited {
    min-height: 18px;
    padding: 0 8px;
    font-size: 11px;
}

/* Precision mode (J11.1): B1's « 2 credits / image » (06-NewBatch.png) and the batch's mark. */
.pill--precision {
    background: var(--px-accent-soft);
    color: var(--px-accent-text);
}

.page__titles h1 .pill--precision {
    margin-left: 8px;
    vertical-align: middle;
}

/* ----- B5 Export, B7 credits ------------------------------------------- */

.plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.plan {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--px-border-input);
    border-radius: 14px;
    background: var(--px-surface);
    cursor: pointer;
}

.plan:has(input:checked) {
    padding: 17px 19px;
    border: 2px solid var(--px-accent);
    background: var(--px-accent-soft);
}

.plan__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--px-ink);
    font-size: 17px;
    font-weight: 700;
}

.plan__head input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--px-accent-strong);
}

.plan__price {
    color: var(--px-ink);
    font-family: var(--px-font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.plan__price small {
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

.plan__text {
    color: var(--px-muted);
    font-size: 13px;
}

.modal-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--px-accent-soft-2);
    color: var(--px-accent);
}

/* ----- D1 Integrations ------------------------------------------------- */

.integration {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
}

.integration__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tile {
    display: grid;
    flex: none;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #21759b;
    color: #fff;
    font-family: var(--px-font-display);
    font-size: 18px;
    font-weight: 700;
}

.tile--shopify {
    background: #5e8e3e;
}

.tile--api {
    background: var(--px-accent-strong);
}

.tile--sm {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 15px;
}

.integration__text {
    color: var(--px-muted);
}

.integration__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
}

.code {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    border-radius: 12px;
    background: var(--px-accent-soft);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    white-space: pre;
}

.code .c-key {
    color: var(--px-accent-text);
}

.code--wrap {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.guides {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.guide {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
}

.guide__name {
    color: var(--px-ink);
    font-weight: 700;
}

.list-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ----- D1 connected sites, B5 « Or send directly » (J11.4) ------------- */

.sites {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
}

.site-row__main {
    min-width: 0;
}

.site-row__name {
    color: var(--px-ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.site-row__host {
    overflow-wrap: anywhere;
}

.site-row__seen {
    flex: none;
    text-align: right;
}

.connect-steps summary {
    color: var(--px-accent-text);
    font-weight: 700;
    cursor: pointer;
}

.connect-steps ol {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 8px;
    padding-left: 22px;
    color: var(--px-ink-2);
}

/* D1 « Images arrive late? » (J11.9): WP-Cron, « Check now », a real cron job. */
.connect-steps summary + p {
    margin-top: 10px;
}

.connect-steps p + p {
    margin-top: 6px;
}

/* A file name moves to the next line whole; a longer line breaks at its spaces. */
.connect-steps code {
    display: inline-block;
    max-width: 100%;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--px-neutral-bg);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.send-site {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.send-site__row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.send-site__body {
    flex: 1;
    min-width: 0;
}

.send-site__name {
    overflow-wrap: anywhere;
}

.send-site__host {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.send-site__select {
    width: 100%;
}

/* B5 with several sites (J6.18): one row per site, its box and its state. */
.send-site__sites {
    display: grid;
    gap: 8px;
    max-height: 22rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.send-site__site {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--px-border);
    border-radius: 10px;
}

.send-site__pick {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.send-site__pick input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--px-accent-strong);
}

.send-site__pick .send-site__body {
    display: grid;
}

.send-site__site.is-beyond .send-site__pick {
    cursor: default;
}

.send-site__beyond {
    color: var(--px-warning);
}

.send-site__actions {
    display: flex;
    justify-content: flex-end;
}

.send-site__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.send-site__error {
    flex-basis: 100%;
    overflow-wrap: anywhere;
}

/* B5 while a delivery waits (J11.9): since when, the site's last check, the help and
   the link to the plugin's page on the site. */
.send-site__since,
.send-site__help,
.send-site__paused {
    flex-basis: 100%;
}

.send-site__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.send-site__paused {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--px-border);
    border-radius: 12px;
    color: var(--px-ink);
    font-weight: 700;
}

/* ----- D2 API keys ----------------------------------------------------- */

.key {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: var(--px-radius-input);
    background: var(--px-neutral-bg);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 13px;
    font-weight: 600;
}

/* D2: the Key column shows the beginning of each key only (J2.32). */
.keys-note {
    justify-content: flex-start;
    margin: 0;
}

/* D3: the key's type, WordPress or API (J6.17). */
.key-kinds {
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.key-kinds legend {
    margin-bottom: 6px;
    padding: 0;
}

.key-kinds__plan {
    margin: 0;
}

/* D2: an API key on a plan without the API; D1's API card (J6.17). */
.key-kind__blocked {
    color: var(--px-warning);
}

.integration__plan {
    margin: 0;
}

/* D1: the plan's sites, and a site beyond them (J6.18). */
.integrations__plan-sites {
    margin: 0;
}

.site-row__beyond {
    color: var(--px-warning);
}

.key-reveal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--px-accent-line);
    border-radius: 12px;
    background: var(--px-accent-soft);
}

.key-reveal code {
    overflow-wrap: anywhere;
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 14px;
    font-weight: 700;
}

.callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--px-warning-bg);
    color: var(--px-warning);
}

.callout .icon {
    margin-top: 2px;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* D2 quick start: one request in curl, JavaScript and Python (J9.3). */
.code-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.code-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tabs--sm .tab {
    min-height: 30px;
    padding: 0 12px;
    font-size: 13px;
}

/* D2 « Usage (30 days) »: one column per day, today's in the accent colour (J9.3). */
.usage__total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 6px;
}

.usage__total small {
    margin-left: 0;
}

.usage__chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage__plot {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 140px;
    border-bottom: 1px solid var(--px-border);
    border-radius: 4px 4px 0 0;
}

.usage__plot:focus-visible {
    outline: none;
    box-shadow: var(--px-focus);
}

.usage__day {
    display: flex;
    flex: 1 1 0;
    align-items: flex-end;
    justify-content: center;
    min-width: 0;
    height: 100%;
}

.usage__bar {
    display: block;
    width: 100%;
    max-width: 24px;
    border-radius: 4px 4px 0 0;
    background: var(--px-track);
    transition: background-color 0.12s ease;
}

.usage__day.is-active .usage__bar {
    background: #dfd3c7;
}

.usage__day.is-today .usage__bar {
    background: var(--px-accent);
}

.usage__day.is-today.is-active .usage__bar {
    background: var(--px-accent-hover);
}

.usage__tip {
    position: absolute;
    bottom: calc(100% + 6px);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--px-ink);
    box-shadow: var(--px-shadow-toast);
    color: var(--px-bg-2);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

.usage__tip strong {
    font-size: 13px;
}

.usage__tip--start {
    transform: none;
}

.usage__tip--end {
    transform: translateX(-100%);
}

.usage__axis {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--px-muted);
    font-size: 12px;
    font-weight: 600;
}

/* The API reference (/api-keys/reference, J9.3): the OpenAPI document, rendered. */
.stack--tight {
    gap: 8px;
}

.stack--loose {
    gap: 20px;
}

.reference__text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90ch;
    color: var(--px-ink-2);
    line-height: 1.6;
}

.reference__text code,
.reference__list code,
.field-doc__text code,
.response__text code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--px-neutral-bg);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.reference__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.reference__label {
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reference__label--inline {
    display: inline;
}

.reference__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
    color: var(--px-ink-2);
}

.reference__index {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reference__link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--px-ink);
}

.reference__link:hover {
    background: var(--px-bg-2);
}

.reference__path {
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.reference__path--title {
    font-size: 16px;
}

.reference__summary {
    color: var(--px-muted);
}

.reference__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.reference__meta {
    gap: 8px 12px;
}

.reference__operation {
    scroll-margin-top: 16px;
}

.reference__type {
    font-family: var(--px-font-mono);
    font-size: 13px;
}

.method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    font-family: var(--px-font-mono);
    font-size: 12px;
    font-weight: 700;
}

.method--get {
    background: var(--px-success-bg);
    color: var(--px-success);
}

.method--post {
    background: var(--px-accent-soft);
    color: var(--px-accent-text-2);
}

.method--put,
.method--patch {
    background: var(--px-warning-bg);
    color: var(--px-warning);
}

.method--delete {
    background: var(--px-danger-bg);
    color: var(--px-danger);
}

.fields,
.responses {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.field-doc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-top: 1px solid var(--px-border);
}

.field-doc:first-child {
    padding-top: 0;
    border-top: 0;
}

.field-doc__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.field-doc__name {
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.field-doc__type {
    color: var(--px-muted);
    font-family: var(--px-font-mono);
    font-size: 12px;
}

.field-doc__fact {
    color: var(--px-muted);
    font-size: 12px;
}

.field-doc__required {
    color: var(--px-accent-text);
    font-size: 12px;
    font-weight: 700;
}

.response__line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    color: var(--px-ink-2);
}

.reference__shape {
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.field-doc__text,
.response__text {
    color: var(--px-ink-2);
    font-size: 14px;
    line-height: 1.55;
}

.response {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--px-border);
}

.response:first-child {
    padding-top: 0;
    border-top: 0;
}

.response__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.response__code {
    flex: none;
    font-family: var(--px-font-mono);
}

.response__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 52px;
    padding-left: 12px;
    border-left: 2px solid var(--px-border);
}

.copyable {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.copyable__value {
    padding: 6px 10px;
    border-radius: var(--px-radius-input);
    background: var(--px-neutral-bg);
    color: var(--px-ink);
    font-family: var(--px-font-mono);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* One line per column: in a wrapping column, a long line of code would widen the page. */
.copyable--block {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
}

.copyable--block .code {
    min-width: 0;
}

.copyable--block .copy-button {
    align-self: flex-start;
}

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

    .response__body {
        margin-left: 0;
    }
}

/* ----- E1 Billing, E2 Settings ----------------------------------------- */

/* E2: what deleting the account does (J6.9). */
.deletion-facts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--px-ink-2);
}

.deletion-facts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.deletion-facts .icon {
    flex: none;
    margin-top: 3px;
    color: var(--px-muted);
}

.big-number {
    color: var(--px-ink);
    font-family: var(--px-font-display);
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.big-number small {
    margin-left: 6px;
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.offers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.offer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
}

.offer--featured {
    border: 2px solid var(--px-accent);
    padding: 21px;
}

.offer__name {
    color: var(--px-ink);
    font-size: 17px;
    font-weight: 700;
}

.offer__price {
    color: var(--px-ink);
    font-family: var(--px-font-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.offer__price small {
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

/* Under the price: a yearly offer's total (« billed €84 yearly »), then its savings (J6.21). */
.offer__billed {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: -6px;
    color: var(--px-muted);
    font-size: 13px;
    font-weight: 600;
}

.offer .btn {
    margin-top: auto;
}

.segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: var(--px-track);
}

.segmented button {
    min-height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--px-ink-2);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.segmented button[aria-pressed="true"] {
    background: var(--px-surface);
    color: var(--px-ink);
    box-shadow: 0 1px 2px rgba(20, 6, 0, 0.08);
}

.legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
}

/* ----- Mobile ---------------------------------------------------------- */

@media (min-width: 900px) {
    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 1180px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .images__head,
    .img-row {
        grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.3fr) 100px 120px;
    }

    .images__head > :nth-child(3),
    .img-row > :nth-child(3) {
        display: none;
    }
}

@media (max-width: 899px) {
    :root {
        --px-main-pad-y: 20px;
        --px-main-pad-x: 16px;
    }

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

    .sidebar {
        display: none;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--px-border);
        background: var(--px-bg-2);
    }

    .topbar .brand img {
        height: 27px;
    }

    .main {
        padding-bottom: calc(var(--px-bottom-bar) + 32px);
    }

    .page {
        gap: 16px;
    }

    .page__header {
        flex-direction: column;
        align-items: stretch;
    }

    .page__actions {
        justify-content: flex-start;
    }

    .page__actions--desktop,
    .desktop-only {
        display: none !important;
    }

    h1 {
        font-size: 24px;
    }

    .title-meta {
        display: block;
        margin: 4px 0 0;
        font-size: 14px;
    }

    .page__titles h1 .pill--precision {
        margin: 6px 0 0;
    }

    .grid--2,
    .grid--3,
    .grid--4,
    .guides,
    .plans {
        grid-template-columns: minmax(0, 1fr);
    }

    .stats {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .stats .stat:not(:first-child) {
        display: none;
    }

    .trial {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
    }

    .trial__icon {
        display: none;
    }

    .trial__actions {
        flex-direction: column;
    }

    .trial__actions .btn {
        width: 100%;
    }

    .dropzone--page {
        min-height: 0;
        padding: 28px 16px;
    }

    .dropzone__title {
        font-size: 19px;
    }

    .dropzone__text {
        font-size: 14px;
    }

    .settings-card {
        display: none;
    }

    .settings-card.is-open {
        display: flex;
    }

    .mobile-settings {
        display: flex;
    }

    .widths {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .toolbar__search {
        width: 100%;
    }

    .toolbar__actions {
        display: none;
    }

    .images {
        border: 0;
        background: none;
    }

    .images__head {
        display: none;
    }

    .images__list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .img-row {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 4px 14px;
        padding: 14px;
        border: 1px solid var(--px-border);
        border-radius: var(--px-radius-card);
        background: var(--px-surface);
    }

    .img-row:last-child {
        border-bottom: 1px solid var(--px-border);
    }

    .img-row__original {
        grid-row: span 3;
        align-self: start;
    }

    .img-row__original .img-row__names {
        display: none;
    }

    .thumb {
        width: 64px;
        height: 64px;
    }

    .img-row > :nth-child(3),
    .img-row > :nth-child(4) {
        display: none;
    }

    .img-row > :nth-child(5) {
        display: flex;
    }

    .newname__slug,
    .newname__alt {
        padding: 0;
        border: 0;
        white-space: normal;
    }

    .bottom-bar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 30;
        display: flex;
        gap: 12px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--px-border);
        background: var(--px-surface);
    }

    .bottom-bar .btn {
        flex: 1;
        min-height: 48px;
    }

    .table--stack thead {
        display: none;
    }

    .table--stack,
    .table--stack tbody,
    .table--stack tr,
    .table--stack td {
        display: block;
        width: 100%;
    }

    .table--stack tr {
        position: relative;
        padding: 14px 16px;
        border-bottom: 1px solid var(--px-border);
    }

    .table--stack tr:last-child {
        border-bottom: 0;
    }

    .table--stack td,
    .table--stack td:first-child,
    .table--stack td:last-child {
        padding: 2px 0;
        border: 0;
        white-space: normal;
    }

    .table--stack td[data-label]::before {
        content: attr(data-label) " ";
        color: var(--px-muted);
        font-size: 12px;
        font-weight: 700;
    }

    .table--stack .row-actions,
    .table--stack .cell-end {
        position: absolute;
        top: 12px;
        right: 16px;
        width: auto;
    }

    .card__head,
    .card__body,
    .card__foot,
    .settings-card,
    .integration {
        padding-right: 16px;
        padding-left: 16px;
    }

    .banner {
        flex-wrap: wrap;
        padding: 16px;
    }

    .banner__actions {
        margin-left: 0;
    }

    .drawer__head,
    .drawer__body,
    .drawer__foot {
        padding-right: 16px;
        padding-left: 16px;
    }

    .drawer__foot .btn {
        flex: 1;
    }
}

/* pixs.app is wider than pixs.re: on the narrowest phones, the pill of the spaces keeps the
   room it had (J5.37). */
@media (max-width: 389px) {
    .topbar {
        gap: 8px;
    }

    .topbar .brand {
        padding-right: 0;
    }
}

/* ----- V2 screens waiting for the API (J5.12) -------------------------- */

body.is-bare .app {
    grid-template-columns: minmax(0, 1fr);
}

body.is-bare .sidebar,
body.is-bare .topbar {
    display: none;
}

.page__actions .project-picker {
    width: 280px;
}

.modal .tab {
    min-height: 34px;
    padding: 0 12px;
    font-size: 14px;
}

.projects {
    display: grid;
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.project-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 24px;
    border-top: 1px solid var(--px-border);
}

.project-item.is-active {
    background: var(--px-accent-soft);
}

.project-item__name {
    color: var(--px-ink);
    font-size: 17px;
    font-weight: 700;
}

.project-item__meta {
    color: var(--px-muted);
    font-size: 13px;
}

.chips-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--px-border-input);
    border-radius: var(--px-radius-input);
    background: var(--px-surface);
}

.chips-input:focus-within {
    border-color: var(--px-accent);
    box-shadow: 0 0 0 3px var(--px-accent-soft-2);
}

.chips-input__field {
    flex: 1;
    min-width: 160px;
    border: 0;
    outline: none;
    background: none;
    font-size: 14px;
}

.keyword__remove {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.advanced summary {
    color: var(--px-ink);
    font-weight: 700;
    cursor: pointer;
}

/* J5.8: a project's list item is a link; the context test's results. */
a.project-item {
    color: inherit;
    text-decoration: none;
}

a.project-item:hover {
    background: var(--px-bg-2);
}

a.project-item.is-active:hover {
    background: var(--px-accent-soft);
}

.projects__danger .btn--link {
    color: var(--px-danger);
}

.projects__mobile-title {
    margin: 0;
    font-size: 26px;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.preview-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-width: 0;
}

.preview-item__thumb {
    flex: none;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--px-neutral-bg);
}

.preview-item__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.settings-card__context {
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--px-border);
    font-size: 14px;
}

.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.welcome__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.steps {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step {
    padding: 8px 16px;
    border: 1px solid var(--px-border-input);
    border-radius: var(--px-radius-pill);
    color: var(--px-ink-2);
    font-weight: 700;
}

.steps__line {
    width: 28px;
    height: 2px;
    background: var(--px-border-input);
}

.step.is-active {
    border-color: transparent;
    background: var(--px-accent-soft-2);
    color: var(--px-accent-deep);
}

.welcome__card {
    width: min(780px, 100%);
    padding: 44px;
}

.welcome__card h1 {
    font-size: 34px;
}

.welcome__actions {
    display: flex;
    justify-content: flex-end;
}

.bulk-preview {
    overflow: hidden;
    border: 1px solid var(--px-border);
    border-radius: 12px;
}

.bulk-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--px-border);
    color: var(--px-muted);
    font-family: var(--px-font-mono);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.bulk-row--head {
    border-top: 0;
    background: var(--px-bg-2);
    font-family: var(--px-font-body);
}

.bulk-row__after {
    color: var(--px-ink);
    font-weight: 700;
}

.bulk-row__added {
    color: var(--px-accent-text);
}

.bulk-more {
    padding: 12px 20px;
    border-top: 1px solid var(--px-border);
    background: var(--px-bg-2);
    color: var(--px-muted);
}

/* J5.5: a name left as it is, and why; a name numbered or cut. */
.bulk-row.is-kept .bulk-row__after {
    color: var(--px-muted);
    font-weight: 400;
}

.bulk-row__note {
    display: block;
    margin-top: 2px;
    color: var(--px-muted);
    font-family: var(--px-font-body);
    font-size: 12px;
    font-weight: 400;
}

.bulk-note {
    min-height: 20px;
    margin: 0;
    color: var(--px-muted);
    font-size: 13px;
}

.bulk-note:empty {
    display: none;
}

.member {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--px-accent-soft-2);
    color: var(--px-accent-deep);
    font-weight: 800;
}

/* ----- E2 Team (J6.5) ---------------------------------------------------- */

.avatar--member {
    background: var(--px-success-bg);
    color: var(--px-success);
}

.avatar--pending {
    background: var(--px-neutral-bg);
    color: var(--px-neutral);
}

.team__invite {
    flex-wrap: nowrap;
}

.team__invite .input {
    width: 260px;
}

.team__table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.team__table td:last-child .row {
    justify-content: flex-end;
}

.team__table .strong .muted {
    margin-left: 6px;
    font-weight: 400;
}

.team__full,
.team__desktop,
.team__status {
    padding: 0 24px;
}

.team__status,
.team__desktop {
    padding-bottom: 20px;
    text-align: left;
}

.team__full {
    padding-bottom: 12px;
}

.team__status:empty {
    display: none;
}

.invitation {
    border-color: var(--px-accent-soft-2);
    background: var(--px-accent-soft);
}

.invitation__problem {
    color: var(--px-danger);
}

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

    /* On a phone, /projects is the list and /projects/:id the context (F8). */
    .projects-page--editing .projects__list,
    .projects-page--editing > .page__header,
    .projects-page--list .projects__detail {
        display: none;
    }

    .welcome__card {
        padding: 24px 16px;
    }

    .welcome__card h1 {
        font-size: 26px;
    }

    .welcome__actions .btn {
        width: 100%;
    }

    .steps .step {
        padding: 6px 12px;
        font-size: 13px;
    }

    .page__actions .project-picker {
        flex: 1;
        width: auto;
    }
}

/* ----- Mobile menu (F3) ------------------------------------------------ */

.sheet-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sheet-nav .nav__item {
    min-height: 52px;
    font-size: 17px;
}

.sheet-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--px-muted);
    font-size: 13px;
}
