/*
 * Shipping theme (Sodexi), the look of Cassini and Customer API. Loaded by UNFOLD["STYLES"], by the
 * login pages and by the public tracking page.
 * Plain CSS on purpose: unlayered rules win over Unfold's Tailwind layers without a build step.
 * Tokens: light by default, .dark on <html> (Unfold's own theme switch) for the dark palette.
 * Look: a navy menu, white cards on a light grey page, rounded fields, soft status pills.
 * The rules shared with Cassini come first, Shipping's own screens at the end ("Shipping").
 */
/* Fonts served from our own static files (SIL Open Font License, see ../fonts/OFL-*.txt). */
/* IBM Plex Mono 400 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono 400 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono 500 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono 500 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Geist, variable weight (latin-ext) */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/geist-latin-ext.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Geist, variable weight (latin) */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/geist-latin.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --sx-f: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
    --sx-m: "IBM Plex Mono", SFMono-Regular, Menlo, Consolas, monospace;
    --sx-cyan: #0bbbef;
    /* page, cards, quiet surfaces */
    --sx-bg: #f5f6f9;
    --sx-card: #ffffff;
    --sx-bg2: #fafbfc;
    --sx-hover: #f4f6fb;
    --sx-sel: #eef3ff;
    /* text */
    --sx-ink: #0f1733;
    --sx-text: #1d2540;
    --sx-sub: #4f587a;
    --sx-mute: #6b7391;
    /* lines */
    --sx-line: #e6e8ef;
    --sx-dot: #f0f2f6;
    --sx-field: #dfe3ec;
    --sx-field-h: #c5ccdb;
    /* actions */
    --sx-link: #18255c;
    --sx-link-h: #0b7fa6;
    --sx-btn: #18255c;
    --sx-btn-h: #101a40;
    --sx-btnt: #ffffff;
    --sx-ring: 0 0 0 3px rgba(24, 37, 92, .12);
    /* states: text on a soft ground */
    --sx-ok: #15803d;
    --sx-ok-bg: #e7f6ee;
    --sx-bad: #b42318;
    --sx-bad-bg: #fdecec;
    --sx-warn: #a15c07;
    --sx-warn-bg: #fff3dc;
    --sx-info: #0b6f91;
    --sx-info-bg: #e6f8fd;
    --sx-tint: #eef2fb;
    /* menu */
    --sx-nav: #0e1838;
    --sx-nav-t: #c3cbe3;
    --sx-nav-s: #a3aed0;
    --sx-nav-m: #7f8bb3;
    /* shape */
    --sx-r: 8px;
    --sx-rc: 12px;
    --sx-sh: 0 1px 2px rgba(16, 24, 40, .04);
    --sx-pop: 0 16px 40px -12px rgba(14, 24, 56, .28), 0 0 0 1px rgba(14, 24, 56, .06);
    --sx-logo: none;
    --font-sans: var(--sx-f);
    --font-mono: var(--sx-m);
}

.dark {
    --sx-bg: #0b1020;
    --sx-card: #121a30;
    --sx-bg2: #0f1629;
    --sx-hover: #18213a;
    --sx-sel: #1a2647;
    --sx-ink: #f1f3f9;
    --sx-text: #d3d8e6;
    --sx-sub: #aab2cb;
    --sx-mute: #8d96b3;
    --sx-line: #222c47;
    --sx-dot: #1a2238;
    --sx-field: #2a3555;
    --sx-field-h: #3a4770;
    --sx-link: #8fd3f5;
    --sx-link-h: #c4ebfb;
    --sx-btn: #0bbbef;
    --sx-btn-h: #3fcaf3;
    --sx-btnt: #07112b;
    --sx-ring: 0 0 0 3px rgba(11, 187, 239, .22);
    --sx-ok: #5fd39a;
    --sx-ok-bg: rgba(34, 160, 107, .16);
    --sx-bad: #ff8b80;
    --sx-bad-bg: rgba(229, 72, 77, .16);
    --sx-warn: #f5c26b;
    --sx-warn-bg: rgba(245, 158, 11, .14);
    --sx-info: #7fd6f3;
    --sx-info-bg: rgba(11, 187, 239, .14);
    --sx-tint: #1a2647;
    --sx-nav: #080d1c;
    --sx-sh: 0 1px 2px rgba(0, 0, 0, .3);
    --sx-pop: 0 16px 40px -12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    --sx-logo: brightness(0) invert(1);
    color-scheme: dark;
}

/* ---------- base ---------- */

html, body {
    font-family: var(--sx-f);
}

body {
    background: var(--sx-bg);
    color: var(--sx-text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" 0;
}

#main,
#page {
    background: var(--sx-bg);
}

a {
    transition: color .15s;
}

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

.sx-mono {
    font-family: var(--sx-m);
}

/* a small name above a value; sentence case, never shouted */
.sx-cap {
    display: block;
    margin-bottom: 6px;
    color: var(--sx-mute);
    font: 500 12px/1.3 var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

.sx-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sx-ico {
    display: block;
    flex: none;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* selection boxes of the lists */
input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    border: 1.5px solid var(--sx-field-h);
    border-radius: 4px;
    background: var(--sx-card);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

input[type=checkbox]:hover {
    border-color: var(--sx-mute);
}

input[type=checkbox]:checked {
    border-color: var(--sx-btn);
    background: var(--sx-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

/* Unfold draws the tick with an icon font and forces its display: no content, no glyph */
input[type=checkbox]::after,
input[type=checkbox]::before {
    content: none !important;
    display: none !important;
}

.material-symbols-outlined {
    font-size: 18px;
}

@keyframes sx-up {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes sx-grow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes sx-grow-x {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes sx-pop {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- buttons ---------- */

.sx-btn,
.sx-add,
.sx-ctl .object-tools a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-text) !important;
    font: 500 13px var(--sx-f);
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.sx-btn:hover {
    border-color: var(--sx-field-h);
}

.sx-add,
.sx-ctl .object-tools a {
    border-color: var(--sx-btn);
    background: var(--sx-btn);
    color: var(--sx-btnt) !important;
}

.sx-add:hover,
.sx-ctl .object-tools a:hover {
    border-color: var(--sx-btn-h);
    background: var(--sx-btn-h);
}

/* ---------- theme switch ---------- */

.sx-theme {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 9px;
    background: var(--sx-hover);
    font: 500 12px/1 var(--sx-f);
}

.sx-theme button {
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--sx-mute);
    font: inherit;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.sx-theme button.on {
    background: var(--sx-card);
    color: var(--sx-ink);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}

/* ---------- menu ---------- */

.sx-rail-wrap {
    position: relative;
    z-index: 50;
    flex: none;
    width: 260px;
}

.sx-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--sx-nav);
    color: var(--sx-nav-t);
}

.sx-rail__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sx-brand {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
}

.sx-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.sx-brand__t {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sx-brand__t b {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.sx-brand__t s {
    color: #8a96bd;
    font-size: 11.5px;
    text-decoration: none;
}

.sx-close,
.sx-menu {
    display: none;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 13px;
    cursor: pointer;
}

.sx-nav {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 4px 0 12px;
    scrollbar-color: rgba(255, 255, 255, .14) transparent;
    scrollbar-width: thin;
}

.sx-sec:not(:has(li)) {
    display: none;
}

/* group headings: Operations, System */
.sx-grp {
    padding: 18px 30px 6px;
    color: var(--sx-nav-m);
    font: 600 10.5px/1 var(--sx-f);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sx-sec {
    padding: 0 12px;
}

.sx-sec__h {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--sx-r);
    background: none;
    color: var(--sx-nav-t);
    font: 500 13px var(--sx-f);
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.sx-sec__h:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.sx-sec:has(.sx-item.on) > .sx-sec__h {
    background: rgba(11, 187, 239, .14);
    color: #fff;
}

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

.sx-sec__n,
.sx-item i {
    min-width: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #e5484d;
    color: #fff;
    font: 600 10.5px/1.2 var(--sx-f);
    font-style: normal;
    text-align: center;
}

.sx-sec.open .sx-sec__n {
    display: none;
}

.sx-sec__m {
    flex: none;
    width: 6px;
    height: 6px;
    margin: 0 3px 0 0;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    opacity: .6;
    transform: rotate(-45deg);
    transition: transform .2s ease;
}

.sx-sec.open .sx-sec__m {
    transform: rotate(45deg);
}

.sx-sec__b {
    display: none;
    margin: 0;
    padding: 2px 0 6px;
    list-style: none;
}

.sx-sec.open .sx-sec__b {
    display: block;
    animation: sx-up .2s ease both;
}

.sx-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    padding: 5px 10px 5px 37px;
    border-radius: 7px;
    color: var(--sx-nav-s);
    font-size: 12.5px;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}

.sx-item:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.sx-item.on {
    color: #fff;
    font-weight: 600;
}

.sx-item.on::before {
    content: "";
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 20px;
    width: 2px;
    border-radius: 2px;
    background: var(--sx-cyan);
}

.sx-rail__foot {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    margin: 0 14px;
    padding: 12px 6px 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--sx-nav-m);
    font: 400 11.5px var(--sx-m);
}

.sx-rail__foot img {
    display: block;
    height: 15px;
    filter: brightness(0) invert(1);
    opacity: .7;
}

.sx-rail__foot .sx-env {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 8px;
    border-radius: 6px;
    font: 600 11px var(--sx-f);
    letter-spacing: 0;
}

/* the environment pulses like a radar: a dot and a ring that spreads and fades */
.sx-rail__foot .sx-env::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: sx-radar 1.6s ease-out infinite;
}

.sx-rail__foot .sx-env--danger::before {
    --sx-radar: rgba(255, 139, 128, .75);
}

.sx-rail__foot .sx-env--success::before {
    --sx-radar: rgba(95, 211, 154, .75);
}

.sx-rail__foot .sx-env--warning::before,
.sx-rail__foot .sx-env--info::before {
    --sx-radar: rgba(251, 191, 36, .75);
}

/* a status signal, not decoration: it keeps pulsing even when the system asks for less motion */
@keyframes sx-radar {
    0% { box-shadow: 0 0 0 0 var(--sx-radar, rgba(255, 255, 255, .6)); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .sx-rail__foot .sx-env::before {
        animation: sx-radar 1.6s ease-out infinite !important;
    }
}

.sx-rail__foot .sx-env--warning,
.sx-rail__foot .sx-env--info {
    background: rgba(245, 158, 11, .14);
    color: #fbbf24;
}

.sx-rail__foot .sx-env--danger {
    background: rgba(229, 72, 77, .16);
    color: #ff8b80;
}

.sx-rail__foot .sx-env--success {
    background: rgba(34, 160, 107, .16);
    color: #5fd39a;
}

.sx-empty {
    padding: 20px;
}

/* ---------- top bar and page head ---------- */

#main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sx-bar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: flex-end;
    height: 60px;
    padding: 0 28px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-card);
    font-size: 13px;
}

/* where the page sits: Administration › app › list › record */
.sx-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-right: auto;
    overflow: hidden;
    color: var(--sx-mute);
    font-size: 13px;
    white-space: nowrap;
}

.sx-crumbs a {
    color: var(--sx-mute);
    text-decoration: none;
}

.sx-crumbs a:hover {
    color: var(--sx-ink);
}

.sx-crumbs b {
    overflow: hidden;
    color: var(--sx-ink);
    font-weight: 500;
    text-overflow: ellipsis;
}

.sx-crumbs i {
    flex: none;
    width: 5px;
    height: 5px;
    border-top: 1.5px solid var(--sx-field-h);
    border-right: 1.5px solid var(--sx-field-h);
    transform: rotate(45deg);
}

.sx-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sx-env {
    font: 600 11px var(--sx-f);
}

.sx-env--danger,
.sx-env--warning {
    color: var(--sx-bad);
}

.sx-env--success {
    color: var(--sx-ok);
}

/* account: initials in a round button, the menu under it */
.sx-acct {
    position: relative;
}

/* the account button: initials, name, a small arrow */
.sx-who {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px 0 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    color: var(--sx-text);
    font: 500 13px var(--sx-f);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.sx-who:hover,
.sx-acct.is-open > .sx-who {
    border-color: var(--sx-line);
    background: var(--sx-hover);
}

.sx-who__n {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-who .sx-chev {
    color: var(--sx-mute);
}

.sx-acct.is-open .sx-who .sx-chev {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.sx-ava {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sx-tint);
    color: var(--sx-link);
    font: 600 11px/1 var(--sx-f);
    letter-spacing: .02em;
}

.sx-ava--lg {
    width: 40px;
    height: 40px;
    font-size: 13px;
}

.sx-amenu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    min-width: 280px;
    padding: 6px;
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-pop);
}

.sx-acct.is-open .sx-amenu {
    display: block;
    animation: sx-pop .18s ease both;
}

.sx-amenu__who {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    padding: 10px 10px 14px;
    border-bottom: 1px solid var(--sx-line);
}

.sx-amenu__who b {
    display: block;
    color: var(--sx-ink);
    font-size: 14px;
    font-weight: 600;
}

.sx-amenu__who s {
    display: block;
    margin-top: 2px;
    color: var(--sx-mute);
    font-size: 12px;
    text-decoration: none;
}

.sx-amenu a,
.sx-amenu button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--sx-text);
    font: 400 13.5px var(--sx-f);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.sx-amenu a:hover,
.sx-amenu button:hover {
    background: var(--sx-hover);
    color: var(--sx-ink);
}

.sx-amenu__theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 8px 10px;
}

.sx-amenu__theme .sx-cap {
    margin: 0;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--sx-text);
}

.sx-amenu .sx-theme button {
    display: inline-block;
    width: auto;
    padding: 6px 10px;
    border-radius: 6px;
    font: 500 12px/1 var(--sx-f);
}

.sx-amenu .sx-theme button:hover {
    background: none;
    color: var(--sx-ink);
}

.sx-amenu .sx-theme button.on:hover {
    background: var(--sx-card);
}

.sx-amenu form {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px solid var(--sx-line);
}

.sx-amenu form button {
    color: var(--sx-bad);
}

/* breadcrumbs, rendered by Unfold under the header, laid over the bar */
#main > .px-4:has(> div > ul.flex-wrap) {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    right: 480px;
    height: 60px;
    padding: 0 28px;
    overflow: hidden;
}

#main > .px-4:has(> div > ul.flex-wrap) > div {
    max-width: none;
    margin: 0;
    height: 60px;
    display: flex;
    align-items: center;
}

#main > .px-4 ul.flex-wrap {
    flex-wrap: nowrap;
    white-space: nowrap;
}

#main > .px-4 ul.flex-wrap li {
    color: var(--sx-ink);
    font-size: 13px;
    font-weight: 500;
}

#main > .px-4 ul.flex-wrap li a {
    color: var(--sx-mute);
    font-weight: 400;
    text-decoration: none;
}

#main > .px-4 ul.flex-wrap li a:hover {
    color: var(--sx-ink);
}

#main > .px-4 ul.flex-wrap li span {
    margin: 0 8px;
    color: var(--sx-field-h);
}

.sx-head {
    position: relative;
    flex: none;
    padding: 24px 28px 4px;
}

.sx-head h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
    margin: 0;
    color: var(--sx-ink);
    font: 600 22px/1.25 var(--sx-f);
    letter-spacing: -.02em;
}

.sx-head h1 > span {
    order: 2;
    flex-basis: 100%;
    margin-top: 4px;
    color: var(--sx-mute);
    font: 400 13px var(--sx-f);
    letter-spacing: 0;
}

/* ---------- content area ---------- */

#main > .px-4,
#main > .px-4.pb-8 {
    padding-left: 0;
    padding-right: 0;
}

#main > .px-4.pb-8 {
    padding-bottom: 0;
}

#content,
#content.container {
    max-width: none;
    width: 100%;
}

body.change-form #content,
body.delete-confirmation #content,
body:not(.change-list) #content-main {
    padding: 20px 28px 32px;
}

body.change-form #content {
    padding: 0;
}

/* messages */
#main > .px-4 > div > ul.flex.flex-col {
    gap: 8px;
    margin: 16px 28px 0;
}

#main > .px-4 > div > ul.flex.flex-col > li > div {
    margin: 0;
    padding: 12px 16px;
    border: 1px solid #c3e8d2;
    border-radius: 10px;
    background: var(--sx-ok-bg);
    color: var(--sx-ok);
    font-size: 13.5px;
    font-weight: 500;
    animation: sx-up .3s ease both;
}

#main > .px-4 > div > ul.flex.flex-col > li > div[class*="red"] {
    border-color: #f5c2c0;
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
}

#main > .px-4 > div > ul.flex.flex-col > li > div[class*="orange"],
#main > .px-4 > div > ul.flex.flex-col > li > div[class*="yellow"] {
    border-color: #f6d9a8;
    background: var(--sx-warn-bg);
    color: var(--sx-warn);
}

#main > .px-4 > div > ul.flex.flex-col > li > div[class*="blue"] {
    border-color: #bfe6f4;
    background: var(--sx-info-bg);
    color: var(--sx-info);
}

.dark #main > .px-4 > div > ul.flex.flex-col > li > div {
    border-color: transparent;
}

.sx-msg {
    width: 420px;
    max-width: 100%;
    margin-top: 20px;
    padding: 11px 15px;
    border-radius: 10px;
    background: var(--sx-info-bg);
    color: var(--sx-info);
    font-size: 13.5px;
    font-weight: 500;
}

.sx-msg--bad {
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
}

/* ---------- change list ---------- */

#changelist {
    margin: 0;
}

#changelist .changelist-form-container {
    gap: 0;
    margin: 16px 28px 0;
    padding: 0;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

#changelist-filter {
    display: none !important;
}

#changelist .changelist-form-container > div > div:has(> .sx-ctl) {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.sx-ctl {
    position: relative;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sx-line);
    border-radius: var(--sx-rc) var(--sx-rc) 0 0;
    background: var(--sx-card);
}

.sx-ctl #toolbar {
    flex: 0 1 300px;
    min-width: 180px;
    padding: 0;
}

.sx-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-mute);
    cursor: text;
    transition: border-color .15s, box-shadow .15s;
}

.sx-search:hover {
    border-color: var(--sx-field-h);
}

.sx-search:focus-within {
    border-color: var(--sx-btn);
    box-shadow: var(--sx-ring);
}

.sx-search .sx-ico {
    width: 15px;
    height: 15px;
}

.sx-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
}

.sx-search input::placeholder {
    color: var(--sx-mute);
    opacity: 1;
}

.sx-ctl .object-tools {
    display: flex;
    flex: none;
    gap: 8px;
    margin: 0 0 0 auto;
}

.sx-ctl > .sx-add {
    flex: none;
    margin-left: auto;
}

/* date hierarchy: a line of links above the control strip, hidden when it has none */
#changelist .changelist-form-container .mb-4:has(> ul.toplinks) {
    margin: 0;
    padding: 10px 16px;
    border-bottom: 1px solid var(--sx-line);
}

#changelist .changelist-form-container .mb-4:has(> ul.toplinks):not(:has(li)) {
    display: none;
}

ul.toplinks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font: 500 12.5px var(--sx-f);
}

ul.toplinks li {
    padding: 0;
    color: var(--sx-ink);
}

ul.toplinks a {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--sx-hover);
    color: var(--sx-sub);
    text-decoration: none;
}

ul.toplinks a:hover {
    color: var(--sx-ink);
}

ul.toplinks .material-symbols-outlined {
    display: none;
}

/* filters: one line of chips in the control strip */
.sx-fz {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sx-fcell {
    position: relative;
    flex: none;
}

.sx-fbtn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px dashed var(--sx-field-h);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-sub);
    font: 400 12.5px var(--sx-f);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.sx-fbtn:hover {
    border-color: var(--sx-mute);
}

.sx-fbtn > span {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.sx-fbtn .sx-cap {
    margin: 0;
    color: inherit;
    font: 500 12.5px var(--sx-f);
}

.sx-fbtn .sx-cap::after {
    content: " :";
}

.sx-fval {
    display: block;
    max-width: 220px;
    overflow: hidden;
    color: var(--sx-mute);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-fcell.is-set .sx-fbtn {
    border-style: solid;
    border-color: #c9d3ee;
    background: #f2f5fc;
    color: var(--sx-link);
}

.dark .sx-fcell.is-set .sx-fbtn {
    border-color: #2f3d66;
    background: var(--sx-tint);
}

.sx-fcell.is-set .sx-fval {
    color: var(--sx-link);
    font-weight: 600;
}

.sx-chev {
    flex: none;
    width: 6px;
    height: 6px;
    margin: -3px 1px 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    opacity: .7;
    transform: rotate(45deg);
    transition: transform .15s;
}

.sx-fcell.is-open .sx-chev {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.sx-fmenu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 100%;
    max-width: 380px;
    max-height: 340px;
    overflow: auto;
    padding: 4px;
    border-radius: 10px;
    background: var(--sx-card);
    box-shadow: var(--sx-pop);
}

.sx-fcell.is-open .sx-fmenu {
    display: block;
    animation: sx-pop .16s ease both;
}

.sx-ctl .sx-fsearch {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--sx-line);
    border-radius: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
}

.sx-fopt {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    overflow: hidden;
    color: var(--sx-text) !important;
    font-size: 13px;
    text-decoration: none !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-fopt:hover {
    background: var(--sx-hover);
    color: var(--sx-ink) !important;
}

.sx-fopt.is-on {
    background: var(--sx-tint);
    color: var(--sx-link) !important;
    font-weight: 600;
}

.sx-head .sx-freset {
    position: relative;
    z-index: 1;
    order: 1;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--sx-tint);
    color: var(--sx-link);
    font: 500 12.5px var(--sx-f);
    letter-spacing: 0;
    text-decoration: none;
}

.sx-head .sx-freset:hover {
    color: var(--sx-link-h);
}

/* result table */
#changelist-form > div.overflow-x-auto,
#changelist-form .simplebar-horizontal-scrollbar-top {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

/* lists fit the width of the page: values stay on one line until js/tables.js finds the list too
   wide, then it gets tighter and its long values wrap; no sideways scrolling */
#result_list {
    width: 100%;
    table-layout: auto;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

#result_list thead th {
    padding: 0 12px;
    height: 38px;
    border: 0;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
    color: var(--sx-sub);
    font: 600 12px/1.2 var(--sx-f);
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    white-space: nowrap;
    vertical-align: middle;
}

#result_list thead th a,
#result_list thead th div {
    color: var(--sx-sub);
    font: inherit;
    text-decoration: none;
}

#result_list thead th a:hover {
    color: var(--sx-ink);
}

#result_list tbody,
#result_list tbody tr {
    border: 0;
    background: none;
    animation: sx-up .3s ease both;
}

#result_list tbody td,
#result_list tbody th {
    max-width: none;
    /* references stay whole; only paths and links (in a) break where they must */
    overflow-wrap: break-word;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid var(--sx-dot);
    background: none;
    color: var(--sx-text);
    font: 400 13px/1.45 var(--sx-f);
    vertical-align: middle;
    white-space: nowrap;
    transition: background .12s;
}

#result_list tbody tr:last-child td,
#result_list tbody tr:last-child th {
    border-bottom: 0;
}

#result_list tbody th a,
#result_list tbody td:first-child + th a,
#result_list tbody th {
    color: var(--sx-ink);
    font-weight: 600;
}

#result_list tbody tr:hover td,
#result_list tbody tr:hover th {
    background: var(--sx-hover);
}

#result_list tbody tr.selected td,
#result_list tbody tr.selected th,
#result_list tbody tr:has(input[type=checkbox]:checked) td,
#result_list tbody tr:has(input[type=checkbox]:checked) th {
    background: var(--sx-sel);
}

#result_list thead th:first-child,
#result_list tbody td:first-child,
#result_list tbody th:first-child {
    padding-left: 16px;
}

#result_list thead th:last-child,
#result_list tbody td:last-child {
    padding-right: 16px;
}

#result_list tbody td a {
    overflow-wrap: anywhere;
    text-decoration: none;
}

/* js/tables.js: a list wider than the page first gets tighter, then breaks its long values */
#result_list.sx-dense thead th,
#result_list.sx-dense tbody td,
#result_list.sx-dense tbody th {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12px;
}

#result_list.sx-dense thead th:first-child,
#result_list.sx-dense tbody td:first-child,
#result_list.sx-dense tbody th:first-child {
    padding-left: 16px;
}

#result_list.sx-wrap tbody td,
#result_list.sx-wrap tbody th {
    white-space: normal;
}

#result_list .action-checkbox,
#result_list .action-checkbox-column {
    width: 44px;
}

/* status helpers rendered by the model admins (labels, booleans): soft pills */
#result_list span[class*="bg-green"],
#result_list span[class*="bg-red"],
#result_list span[class*="bg-orange"],
#result_list span[class*="bg-yellow"],
#result_list span[class*="bg-blue"],
#result_list span[class*="bg-base"],
#result_list span[class*="bg-primary"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font: 500 12px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

#result_list span[class*="bg-green"] { background: var(--sx-ok-bg); color: var(--sx-ok); }
#result_list span[class*="bg-red"] { background: var(--sx-bad-bg); color: var(--sx-bad); }
#result_list span[class*="bg-orange"],
#result_list span[class*="bg-yellow"] { background: var(--sx-warn-bg); color: var(--sx-warn); }
#result_list span[class*="bg-blue"],
#result_list span[class*="bg-primary"] { background: var(--sx-info-bg); color: var(--sx-info); }
#result_list span[class*="bg-base"] { background: var(--sx-hover); color: var(--sx-sub); }

#result_list span[class*="bg-"]::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* empty change list */
#changelist-form p,
#changelist .grow > p {
    padding: 22px 16px;
    color: var(--sx-mute);
}

/* selection actions bar: a dark bar floating at the foot of the page */
#changelist-form > div.fixed {
    justify-content: center;
    /* above the pagination bar */
    padding: 12px 28px 60px;
    background: none;
    box-shadow: none;
    pointer-events: none;
}

#changelist-form > div.fixed > * {
    pointer-events: auto;
}

#changelist-actions-wrapper {
    flex: none;
    max-width: 100%;
    margin: 0 auto;
}

#changelist-actions .grow {
    flex: none;
    width: 240px;
}

#changelist-actions {
    display: inline-block;
    width: auto !important;
    margin: 0;
    color: #fff;
    animation: sx-up .25s ease both;
}

#changelist-actions > div {
    display: inline-flex;
    gap: 14px;
    padding: 8px 16px 8px 8px;
    border-radius: 12px;
    background: #0e1838 !important;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 16px 36px -10px rgba(14, 24, 56, .6);
}

.dark #changelist-actions > div {
    background: #1a2647 !important;
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08);
}

#changelist-actions select {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--sx-r);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 13px;
}

#changelist-actions button,
#changelist-actions a {
    border-radius: var(--sx-r);
    background: #fff;
    color: var(--sx-nav);
    font-weight: 600;
}

/* pagination */
.sx-foot {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    margin-top: auto;
    padding: 0 28px;
    border-top: 1px solid var(--sx-line);
    background: color-mix(in srgb, var(--sx-card) 92%, transparent);
    backdrop-filter: blur(8px);
    color: var(--sx-mute);
    font: 400 12.5px var(--sx-f);
}

.sx-foot b {
    margin: 0 4px;
    color: var(--sx-ink);
    font-weight: 600;
}

.sx-pages {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sx-pages a,
.sx-pages span,
.sx-pages b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    margin: 0;
    padding: 0 8px;
    border-radius: 7px;
    color: var(--sx-sub);
    text-decoration: none;
}

.sx-pages a:hover {
    background: var(--sx-hover);
    color: var(--sx-ink);
}

.sx-pages b,
.sx-pages .font-medium {
    background: var(--sx-btn);
    color: var(--sx-btnt);
    font-weight: 600;
}

#main > div:has(> .sx-foot) {
    margin-top: auto;
    padding: 0;
    border: 0;
    background: none;
    backdrop-filter: none;
}

/* ---------- change form ---------- */

body.change-form #content-main {
    padding: 0;
}

body.change-form #content > div:first-child:has(nav, a) {
    margin: 0;
    padding: 0 28px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-card);
}

#content nav a,
#content [x-on\:click*="activeTab"] {
    border-radius: 0;
}

form fieldset.module {
    margin: 20px 28px 0;
    padding: 20px;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
    animation: sx-up .35s cubic-bezier(.2, .7, .2, 1) both;
}

form fieldset.module > h2 {
    height: auto;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--sx-ink);
    font: 600 14px var(--sx-f);
}

/* fields in a grid, the name above the value; long fields take the whole line */
form fieldset.module > .aligned {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px 20px;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
}

form fieldset.module > .aligned > .form-row {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

form fieldset.module > .aligned > .form-row:has(textarea, select[multiple], .vLargeTextField, .inline-group, .selector) {
    grid-column: 1 / -1;
}

form fieldset.module .field-line {
    padding: 0;
}

form fieldset.module label {
    display: block;
    margin-bottom: 6px;
    color: var(--sx-sub);
    font: 500 12px/1.3 var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

form fieldset.module label .text-red-600,
form fieldset.module label .required {
    color: var(--sx-bad);
}

form fieldset.module input[type=text],
form fieldset.module input[type=number],
form fieldset.module input[type=email],
form fieldset.module input[type=url],
form fieldset.module input[type=password],
form fieldset.module input[type=date],
form fieldset.module input[type=time],
form fieldset.module input[type=datetime-local],
form fieldset.module textarea,
form fieldset.module select:not([multiple]) {
    width: 100%;
    max-width: none;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    outline: 0;
    background: var(--sx-card);
    box-shadow: none;
    color: var(--sx-ink);
    font: 400 13.5px/1.35 var(--sx-f);
    transition: border-color .15s, box-shadow .15s;
}

form fieldset.module input:hover,
form fieldset.module textarea:hover,
form fieldset.module select:not([multiple]):hover {
    border-color: var(--sx-field-h);
}

form fieldset.module input:focus,
form fieldset.module textarea:focus,
form fieldset.module select:not([multiple]):focus {
    border-color: var(--sx-btn);
    box-shadow: var(--sx-ring);
}

form fieldset.module input[readonly],
form fieldset.module input:disabled {
    background: var(--sx-bg2);
    color: var(--sx-sub);
}

form fieldset.module textarea {
    height: auto;
    min-height: 90px;
    padding: 8px 10px;
}

form fieldset.module select:not([multiple]) {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 30px;
    background: var(--sx-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7391' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 12px no-repeat;
}

form fieldset.module .readonly {
    min-height: 36px;
    padding: 8px 0 0;
    color: var(--sx-ink);
    font: 500 13.5px/1.35 var(--sx-f);
}

form fieldset.module .help,
form fieldset.module [class*="text-font-subtle"] {
    margin-top: 6px;
    color: var(--sx-mute);
    font: 400 12px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

form fieldset.module .errorlist,
form fieldset.module .errorlist li {
    margin: 6px 0 0;
    padding: 0;
    color: var(--sx-bad);
    font-size: 12.5px;
    list-style: none;
}

form fieldset.module .form-row.errors input,
form fieldset.module .form-row.errors select,
form fieldset.module .form-row.errors textarea,
form fieldset.module .form-row.errors .sx-select__btn {
    border-color: var(--sx-bad);
}

/* related object links (edit, add, view, lookup): small words after the value */
.related-widget-wrapper {
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

.related-widget-wrapper > div.grow,
.related-widget-wrapper > .sx-select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.related-widget-wrapper-link,
a.related-widget-wrapper-link,
.related-lookup,
a.related-lookup {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--sx-link-h) !important;
    font: 500 12px/1.2 var(--sx-f) !important;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
}

.related-lookup::after {
    color: inherit;
    font: inherit;
}

.related-widget-wrapper-link .material-symbols-outlined,
.related-lookup .material-symbols-outlined {
    display: none;
}

.related-widget-wrapper-link::after {
    content: none !important;
}

.related-widget-wrapper-link:hover,
.related-lookup:hover {
    color: var(--sx-ink) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.related-widget-wrapper-link.delete-related:hover {
    color: var(--sx-bad) !important;
}

.related-widget-wrapper-link:not([href]) {
    display: none !important;
}

/* the ⋮ menu of a related field (unfold/widgets/related_widget_wrapper.html, moved under <body>):
   drawn as the menu of a drop-down list, one line per action with its icon */
nav[id^="related-widget-wrapper-"] {
    width: auto !important;
    min-width: 200px;
    max-width: min(320px, calc(100vw - 16px));
    padding: 4px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--sx-card) !important;
    box-shadow: var(--sx-pop) !important;
}

nav[id^="related-widget-wrapper-"] > a.related-widget-wrapper-link {
    display: flex;
    align-items: center;
    gap: 8px;
    max-height: none;
    margin: 0 !important;
    padding: 7px 10px !important;
    border-radius: 6px;
    opacity: 1;
    color: var(--sx-text) !important;
    font: 400 13px/1.3 var(--sx-f) !important;
}

nav[id^="related-widget-wrapper-"] > a.related-widget-wrapper-link .material-symbols-outlined {
    display: inline-block;
    flex: none;
    margin: 0;
    color: var(--sx-mute);
    font-size: 18px;
}

nav[id^="related-widget-wrapper-"] > a.related-widget-wrapper-link:hover {
    background: var(--sx-hover) !important;
    color: var(--sx-ink) !important;
    text-decoration: none !important;
}

nav[id^="related-widget-wrapper-"] > a.related-widget-wrapper-link:hover .material-symbols-outlined {
    color: var(--sx-ink);
}

nav[id^="related-widget-wrapper-"] > a.delete-related,
nav[id^="related-widget-wrapper-"] > a.delete-related .material-symbols-outlined {
    color: var(--sx-bad) !important;
}

nav[id^="related-widget-wrapper-"] > a.delete-related:hover {
    background: var(--sx-bad-bg) !important;
}

.related-lookup::after { content: "Browse"; }

/* date and time fields: words, not icons ("Today", "Calendar", "Now", "Clock") */
form fieldset.module .datetime {
    min-width: 0;
    gap: 12px;
}

form fieldset.module .datetime > div,
form fieldset.module .datetime [class*="min-w-"] {
    min-width: 0;
    margin-left: 0;
}

.datetimeshortcuts {
    top: 0;
    bottom: 0;
    align-items: center;
    gap: 12px;
}

.datetimeshortcuts a,
.datetimeshortcuts a:first-child {
    color: var(--sx-link-h) !important;
    font: 500 12px var(--sx-f) !important;
    text-decoration: none;
}

.datetimeshortcuts a:first-child::after {
    content: none !important;
    display: none !important;
}

.date-icon,
.clock-icon {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    color: inherit !important;
}

.date-icon::after,
.clock-icon::after {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    font: 500 12px var(--sx-f) !important;
}

/* the calendar and the clock open from small line icons at the end of the field */
.date-icon::after,
.clock-icon::after {
    content: "" !important;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    background: var(--sx-mute);
    -webkit-mask: var(--sx-glyph) center / contain no-repeat;
    mask: var(--sx-glyph) center / contain no-repeat;
    vertical-align: middle;
    transition: background .15s;
}

.date-icon::after {
    --sx-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.clock-icon::after {
    --sx-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

.datetimeshortcuts a:hover .date-icon::after,
.datetimeshortcuts a:hover .clock-icon::after {
    background: var(--sx-ink);
}

.datetimeshortcuts {
    right: 10px !important;
}

/* the calendar and the clock that open from them */
.calendarbox,
.clockbox {
    padding: 6px !important;
    border: 0 !important;
    border-radius: var(--sx-rc) !important;
    background: var(--sx-card) !important;
    box-shadow: var(--sx-pop) !important;
    color: var(--sx-text) !important;
    font-family: var(--sx-f);
    animation: sx-pop .16s ease both;
}

.calendar caption,
.clockbox h2,
.calendarbox h2 {
    color: var(--sx-ink) !important;
    font-weight: 600;
}

.calendar table th {
    color: var(--sx-mute) !important;
    font: 500 11.5px var(--sx-f) !important;
    letter-spacing: 0;
    text-transform: none;
}

.calendar table td a {
    border-radius: 7px !important;
    color: var(--sx-text) !important;
    font: 400 13px var(--sx-f);
}

.calendar table td a:hover {
    background: var(--sx-hover) !important;
    color: var(--sx-ink) !important;
}

.calendar table td.today a,
.calendar table td.selected a {
    background: var(--sx-btn) !important;
    color: var(--sx-btnt) !important;
}

.calendarbox a,
.clockbox a {
    color: var(--sx-link);
}

.calendarnav-previous,
.calendarnav-next {
    border-radius: 7px !important;
    color: var(--sx-ink) !important;
}

/* sorted columns: a small arrow after the title */
#result_list thead .sortoptions .material-symbols-outlined {
    display: none;
}

#result_list thead th.sorted,
#result_list thead th.sorted a {
    color: var(--sx-ink);
}

#result_list thead th.sorted .text a::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 0 3px 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

#result_list thead th.sorted.ascending .text a::after {
    margin-bottom: -1px;
    transform: rotate(-135deg);
}

/* two-list selector: words for the moves, the colours of the theme */
.selector-chooser {
    flex: none;
    width: 84px;
    gap: 6px;
    margin: 16px 8px;
}

.selector-chooser li {
    padding: 0;
}

/* the button keeps its full name for screen readers; the eye reads one word */
.selector-add,
.selector-remove {
    width: 100%;
    height: 30px;
    padding: 0;
    border: 1px solid var(--sx-field);
    border-radius: 7px;
    background: var(--sx-card);
    color: var(--sx-ink);
    font-size: 0;
    white-space: nowrap;
}

.selector-add::before,
.selector-remove::before {
    font: 500 12px var(--sx-f);
}

.selector-add::after,
.selector-remove::after {
    content: none !important;
    display: none !important;
}

.selector-add::before {
    content: "Choose";
}

.selector-remove::before {
    content: "Remove";
}

.selector-add:disabled,
.selector-remove:disabled {
    color: var(--sx-field-h);
}

.selector-add:not(:disabled):hover,
.selector-remove:not(:disabled):hover {
    border-color: var(--sx-btn);
}

.selector-chooseall,
.selector-clearall {
    border-color: var(--sx-line) !important;
    font-family: var(--sx-f);
}

.selector-chooseall {
    color: var(--sx-link) !important;
}

.selector-clearall {
    color: var(--sx-bad) !important;
}

/* drop-down lists drawn by the page (js/select.js), the native list stays hidden in the form */
.sx-select {
    position: relative;
    display: block;
    min-width: 0;
}

select[data-sx-select] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

select[data-sx-select] ~ .material-symbols-outlined {
    display: none;
}

.sx-select__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-ink);
    font: 400 13.5px/1.35 var(--sx-f);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.sx-select__btn:hover {
    border-color: var(--sx-field-h);
}

.sx-select.is-open .sx-select__btn,
.sx-select__btn:focus-visible {
    border-color: var(--sx-btn);
    box-shadow: var(--sx-ring);
    outline: 0;
}

.sx-select__btn:disabled {
    background: var(--sx-bg2);
    color: var(--sx-mute);
    cursor: default;
}

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

.sx-select__chev {
    flex: none;
    width: 6px;
    height: 6px;
    margin: -3px 2px 0 0;
    border-right: 1.5px solid var(--sx-mute);
    border-bottom: 1.5px solid var(--sx-mute);
    transform: rotate(45deg);
    transition: transform .15s;
}

.sx-select.is-open .sx-select__chev {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.sx-select__menu {
    position: fixed;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    max-width: min(460px, calc(100vw - 16px));
    padding: 4px;
    border-radius: 10px;
    background: var(--sx-card);
    box-shadow: var(--sx-pop);
    outline: 0;
    animation: sx-pop .14s ease both;
}

.sx-select__search {
    flex: none;
    width: 100%;
    margin-bottom: 4px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--sx-line);
    border-radius: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
}

.sx-select__list {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.sx-select__group {
    padding: 10px 10px 4px;
    color: var(--sx-mute);
    font: 600 11px var(--sx-f);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sx-select__opt {
    padding: 7px 10px;
    border-radius: 6px;
    overflow: hidden;
    color: var(--sx-text);
    font: 400 13px var(--sx-f);
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.sx-select__opt.is-active,
.sx-select__opt:hover {
    background: var(--sx-hover);
    color: var(--sx-ink);
}

.sx-select__opt[aria-selected="true"] {
    background: var(--sx-tint);
    color: var(--sx-link);
    font-weight: 600;
}

.sx-select__opt[aria-disabled="true"] {
    color: var(--sx-field-h);
    cursor: default;
}

/* in the selection bar of change lists, on the dark band */
#changelist-actions .sx-select {
    display: inline-block;
    min-width: 220px;
}

#changelist-actions .sx-select__btn {
    height: 32px;
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: 500 13px var(--sx-f);
}

#changelist-actions .sx-select__chev {
    border-color: #fff;
}

.inline-group td .sx-select__btn {
    height: 32px;
    font-size: 13px;
}

/* select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-container .select2-selection {
    min-height: 36px;
    border: 1px solid var(--sx-field) !important;
    border-radius: var(--sx-r) !important;
    background: var(--sx-card) !important;
    box-shadow: none !important;
    color: var(--sx-ink);
    font: 400 13.5px var(--sx-f);
}

.select2-dropdown {
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--sx-card) !important;
    box-shadow: var(--sx-pop) !important;
}

/* inlines */
.inline-group {
    margin: 20px 28px 0;
}

.inline-group h2 {
    margin: 0 0 12px;
    border: 0;
    background: none;
    color: var(--sx-ink);
    font: 600 14px var(--sx-f);
}

.inline-group table {
    width: 100%;
    max-width: none;
    border-collapse: collapse;
}

.inline-group th {
    padding: 0 12px;
    height: 36px;
    border: 0;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
    color: var(--sx-sub);
    font: 600 12px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

.inline-group td {
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--sx-dot);
    background: none;
}

.inline-group td input,
.inline-group td select {
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--sx-field);
    border-radius: 7px;
    background: var(--sx-card);
    box-shadow: none;
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
}

/* tabular inlines: a framed table with the column names of the lists */
[data-inline-type="tabular"] .formset-wrapper {
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    box-shadow: var(--sx-sh);
    background: var(--sx-card);
}

[data-inline-type="tabular"] table.formset {
    background: none;
}

[data-inline-type="tabular"] thead th {
    padding: 0 12px;
    height: 36px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
    color: var(--sx-sub);
    font: 600 12px/1.2 var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

[data-inline-type="tabular"] tbody td {
    border-color: var(--sx-dot);
}

[data-inline-type="tabular"] tbody p {
    color: var(--sx-mute);
    font: 500 12px var(--sx-f);
}

[data-inline-type="tabular"] .form-actions {
    padding: 12px;
    border-top: 1px solid var(--sx-dot);
}

/* stacked inlines: each record is a titled card like the main one */
[data-inline-type="stacked"] .formset-wrapper > div.border {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

[data-inline-type="stacked"] .formset {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: none;
}

[data-inline-type="stacked"] .form-group > .form-row {
    border: 0;
}

[data-inline-type="stacked"] h3 {
    padding: 0 0 10px;
    border: 0;
    color: var(--sx-ink);
    font: 600 14px var(--sx-f);
}

[data-inline-type="stacked"] h3 strong {
    color: inherit;
    font: inherit;
}

form [data-inline-type="stacked"] fieldset.module fieldset.module {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    animation: none;
}

form [data-inline-type="stacked"] fieldset.module fieldset.module::before {
    content: none;
    display: none;
}

/* "add another": a link, no round icon */
.form-actions {
    padding: 14px 0 0;
    border: 0;
}

.add-row {
    margin: 0;
    color: var(--sx-link);
    font-size: 13px;
    font-weight: 500;
}

.add-row > span:first-child {
    display: none;
}

.form-delete .material-symbols-outlined,
[data-inline-type="tabular"] thead .material-symbols-outlined {
    display: none;
}

/* submit bar: fixed at the foot, the main button on the right */
#submit-row {
    position: sticky;
    bottom: 0;
    z-index: 40;
    margin-top: 24px;
}

#submit-row > div {
    padding: 0;
    border: 0;
    border-top: 1px solid var(--sx-line);
    border-radius: 0;
    background: color-mix(in srgb, var(--sx-card) 92%, transparent);
    backdrop-filter: blur(8px);
}

#submit-row > div > div {
    max-width: none;
    min-height: 60px;
    gap: 8px;
    padding: 12px 28px;
}

#submit-row button,
#submit-row a,
#submit-row input[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-text);
    font: 500 13px var(--sx-f);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}

#submit-row button:hover {
    border-color: var(--sx-field-h);
    background: var(--sx-card);
}

#submit-row button[name="_save"],
#submit-row input[name="_save"] {
    min-width: 120px;
    border-color: var(--sx-btn);
    background: var(--sx-btn);
    color: var(--sx-btnt);
    font-weight: 600;
}

#submit-row button[name="_save"]:hover {
    border-color: var(--sx-btn-h);
    background: var(--sx-btn-h);
}

#submit-row a[href*="/delete/"],
#submit-row .deletelink {
    border-color: transparent;
    background: none;
    color: var(--sx-bad);
}

#submit-row a[href*="/delete/"]:hover,
#submit-row .deletelink:hover {
    background: var(--sx-bad-bg);
}

#submit-row div.mr-auto {
    margin-right: auto;
}

/* object tools on forms (History) */
#content li:has(> a[href$="/history/"]) {
    border: 0;
    border-radius: 0;
}

#content .object-tools a,
#content a[href$="/history/"] {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    box-shadow: none;
    color: var(--sx-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

/* tabs: words on a line, the open one underlined */
#tabs-wrapper {
    margin: 0;
}

#tabs-items {
    gap: 24px;
    padding: 0;
    border-radius: 0;
    background: none;
}

#tabs-items > a {
    padding: 13px 0 11px;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--sx-mute);
    font: 500 13px var(--sx-f);
    text-decoration: none;
    transition: color .15s, border-color .15s;
}

#tabs-items > a:hover {
    background: none;
    color: var(--sx-ink);
}

#tabs-items > a.active,
#tabs-items > a.active:hover {
    border-bottom-color: var(--sx-btn);
    background: none;
    box-shadow: none;
    color: var(--sx-ink);
}

/* a text box opens at a few lines (Django asks 10): it grows by its handle */
form fieldset.module .aligned textarea {
    height: 90px;
    resize: vertical;
}

/* yes/no fields of the forms are switches; the selection boxes of the lists stay boxes */
form fieldset.module input[type=checkbox],
.sx-check input[type=checkbox] {
    position: relative;
    width: 36px;
    min-width: 36px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    background: var(--sx-field);
    box-shadow: none;
    transition: background .2s;
}

form fieldset.module input[type=checkbox]::before,
.sx-check input[type=checkbox]::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: left .2s cubic-bezier(.2, .8, .2, 1.2);
}

form fieldset.module input[type=checkbox]:checked,
.sx-check input[type=checkbox]:checked {
    background: var(--sx-btn);
    box-shadow: none;
}

form fieldset.module input[type=checkbox]:checked::before,
.sx-check input[type=checkbox]:checked::before {
    left: 18px;
    background: #fff;
}

form fieldset.module input[type=checkbox]:focus-visible,
.sx-check input[type=checkbox]:focus-visible {
    outline: 2px solid var(--sx-cyan);
    outline-offset: 2px;
}

form fieldset.module input[type=checkbox]:disabled,
.sx-check input[type=checkbox]:disabled {
    opacity: .5;
    cursor: default;
}

/* yes/no rows: the label on top like the other fields, the switch and its help on the value line */
form fieldset.module .field-line > .flex:has(> .grow input[type=checkbox]) {
    flex-direction: column;
    gap: 0;
    padding: 0;
}

form fieldset.module .field-line > .flex:has(> .grow input[type=checkbox]) > div:first-child {
    width: auto;
    min-width: 0;
    margin: 0;
}

form fieldset.module .field-line > .flex:has(> .grow input[type=checkbox]) > div:first-child label {
    margin: 0 0 8px;
}

form fieldset.module .field-line > .flex:has(> .grow input[type=checkbox]) > .grow > .flex {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

form fieldset.module .field-line > .flex:has(> .grow input[type=checkbox]) > .grow > .flex > div {
    margin: 0;
}

form fieldset.module .form-row:has(input[type=checkbox]) label {
    display: block;
    color: var(--sx-text);
    font: 550 12.5px/1.45 var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

/* the labels of a stacked record stay field names even when one of its fields is a box to tick */
form [data-inline-type="stacked"] .form-group > .form-row .aligned > .form-row:not(:has(input[type=checkbox])) label {
    display: block;
    margin: 0 0 6px;
    color: var(--sx-text);
    font: 550 12.5px/1.45 var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

/* Unfold 0.110 sets the label beside the field: the theme keeps the label above it */
form fieldset.module .field-line {
    flex-direction: column;
    align-items: stretch;
}

form fieldset.module > .aligned .field-line {
    border-bottom: 0;
}

form fieldset.module .field-line > div:first-child:has(> label) {
    display: block;
    width: auto;
    min-width: 0;
    height: auto;
    line-height: inherit;
}

form fieldset.module .field-line > div:first-child:has(> label) > label {
    margin-bottom: 6px;
}

/* Unfold caps the block of each value at 672px (max-w-2xl): a value takes its whole cell */
form fieldset.module [class*="max-w-"] {
    max-width: none;
}

/* an empty line of a record page */
.sx-none {
    margin: 0;
    color: var(--sx-mute);
    font-size: 13.5px;
}

/* the cards only: Unfold's fields carry the same classes and keep the corners of the fields */
#content .module,
#content [class*="rounded-default"][class*="bg-base-50"]:not(input, select, textarea),
#content [class*="rounded-default"][class*="shadow-xs"]:not(input, select, textarea) {
    border-radius: var(--sx-rc);
    box-shadow: none;
}

/* ---------- authentication pages ---------- */

.sx-auth {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    background: var(--sx-card);
}

/* the navy half, drawn behind the head and the foot of the left column */
.sx-auth::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / -1;
    background-color: var(--sx-nav);
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
}

.sx-auth__head,
.sx-auth__main,
.sx-auth__foot {
    position: relative;
    grid-column: 2;
    padding-left: 56px;
    padding-right: 56px;
}

.sx-auth__head {
    display: flex;
    grid-row: 1;
    align-items: center;
    justify-content: flex-end;
    padding-top: 32px;
}

.sx-auth__main {
    grid-row: 2;
    align-self: center;
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
    padding-top: 40px;
    padding-bottom: 40px;
    animation: sx-up .5s cubic-bezier(.2, .7, .2, 1) both;
}

.sx-auth h1 {
    margin: 0;
    color: var(--sx-ink);
    font: 600 26px/1.15 var(--sx-f);
    letter-spacing: -.02em;
}

.sx-auth .lead {
    max-width: 420px;
    margin: 8px 0 0;
    color: var(--sx-mute);
    font-size: 14px;
    line-height: 1.5;
}

.sx-auth .lead b {
    color: var(--sx-ink);
    font-weight: 600;
}

/* the form: fields one under the other, the name above */
.sx-slip {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 380px;
    margin-top: 28px;
}

/* the admin's own form pages: a card of fields in a grid, the button at its foot on the right */
.sx-slip--wide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px 20px;
    width: auto;
    max-width: none;
    margin-top: 0;
    padding: 20px;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
    animation: sx-up .35s cubic-bezier(.2, .7, .2, 1) both;
}

.sx-slip--wide .sx-cell:has(textarea, input[type=file], select[multiple]),
.sx-slip--wide > :not(.sx-cell):not(.sx-go) {
    grid-column: 1 / -1;
}

.sx-slip--wide .sx-cell .sx-cap {
    font-size: 12px;
}

.sx-slip--wide .sx-cell input:not([type=checkbox]):not([type=file]),
.sx-slip--wide .sx-cell select:not([multiple]) {
    height: 36px;
    padding: 0 10px;
    border-radius: var(--sx-r);
    font-size: 13.5px;
}

.sx-slip--wide .sx-cell select:not([multiple]) {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    border: 1px solid var(--sx-field);
    background: var(--sx-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7391' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 12px no-repeat;
    color: var(--sx-ink);
}

.sx-slip--wide .sx-go {
    grid-column: 1 / -1;
    justify-self: end;
    width: auto;
    min-width: 140px;
    height: 36px;
    padding: 0 18px;
    border-radius: var(--sx-r);
    font-size: 13.5px;
}

.sx-cell {
    display: block;
    margin: 0;
    padding: 0;
    cursor: text;
}

.sx-cell .sx-cap {
    margin-bottom: 6px;
    color: var(--sx-sub);
    font-size: 12.5px;
}

.sx-cell input,
.sx-cell textarea {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--sx-field);
    border-radius: 10px;
    outline: 0;
    background: var(--sx-card);
    box-shadow: none;
    color: var(--sx-ink);
    font: 400 14px/1.3 var(--sx-f);
    transition: border-color .15s, box-shadow .15s;
}

.sx-cell input:hover,
.sx-cell textarea:hover {
    border-color: var(--sx-field-h);
}

.sx-cell input:focus,
.sx-cell textarea:focus {
    border-color: var(--sx-btn);
    box-shadow: 0 0 0 4px rgba(24, 37, 92, .1);
}

.sx-cell textarea {
    display: block;
    height: auto;
    min-height: 120px;
    padding: 10px 12px;
    font: 400 13px/1.5 var(--sx-m);
    resize: vertical;
}

.sx-cell input[type=file] {
    height: auto;
    padding: 8px;
    font: 400 13px var(--sx-f);
    color: var(--sx-text);
    cursor: pointer;
}

.sx-cell input[type=file]::file-selector-button {
    margin-right: 14px;
    padding: 6px 12px;
    border: 1px solid var(--sx-field);
    border-radius: 7px;
    background: var(--sx-card);
    color: var(--sx-ink);
    font: 500 12.5px var(--sx-f);
    cursor: pointer;
}

.sx-cell--bad input,
.sx-cell--bad textarea {
    border-color: var(--sx-bad);
}

.sx-go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--sx-btn);
    color: var(--sx-btnt) !important;
    font: 600 14px var(--sx-f);
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s, transform .1s;
}

.sx-go:hover {
    background: var(--sx-btn-h);
}

.sx-go:active {
    transform: scale(.99);
}

.sx-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    color: var(--sx-text);
    font-size: 13.5px;
    cursor: pointer;
}

.sx-under {
    margin-top: 14px;
}

.sx-under button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--sx-link);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
}

.sx-rules {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--sx-bg2);
    list-style: none;
    color: var(--sx-mute);
    font-size: 12.5px;
}

.sx-rules ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sx-err {
    display: block;
    margin-top: 6px;
    color: var(--sx-bad);
    font: 400 12.5px var(--sx-f);
}

.sx-lead {
    max-width: 560px;
    margin: 0;
    color: var(--sx-mute);
    font-size: 14px;
}

.sx-auth__foot {
    display: flex;
    flex-wrap: wrap;
    grid-row: 3;
    align-items: center;
    gap: 8px 18px;
    padding-top: 18px;
    padding-bottom: 22px;
    color: var(--sx-mute);
    font-size: 11.5px;
}

.sx-auth__foot img {
    display: block;
}

.sx-auth__foot .sx-sodexi {
    height: 18px;
    filter: var(--sx-logo);
}

.sx-auth__foot .sx-af {
    height: 10px;
}

.dark .sx-auth__foot .sx-af {
    filter: brightness(0) invert(1);
}

.sx-auth__foot .sx-sp {
    margin-left: auto;
}

/* ---------- details ---------- */

/* horizontal scrollbar of wide lists, under the column titles */
#changelist-form .simplebar-track.simplebar-horizontal {
    height: 8px;
    background: var(--sx-bg2);
    cursor: pointer;
}

#changelist-form .simplebar-scrollbar::before {
    top: 2px;
    bottom: 2px;
    left: 0;
    right: 0;
    border-radius: 999px;
    background: var(--sx-field-h);
    opacity: 1;
}

#changelist-form .simplebar-track.simplebar-horizontal:hover .simplebar-scrollbar::before {
    background: var(--sx-mute);
}

#changelist-form .simplebar-horizontal-scrollbar-top > .simplebar-track.simplebar-horizontal {
    top: 0 !important;
    bottom: auto !important;
}

#changelist-form > div.simplebar-horizontal-scrollbar-top:has(> .simplebar-track.simplebar-horizontal[style*="visible"]) {
    padding-top: 8px;
}

#result_list a {
    color: var(--sx-link);
}

#result_list a:hover {
    color: var(--sx-link-h);
}

#result_list thead a {
    color: var(--sx-sub);
}

.sx-foot > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: auto;
}

/* empty list: a designed empty state */
.sx-emptylist {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    color: var(--sx-mute);
    font-size: 13.5px;
    text-align: center;
}

.sx-emptylist::before {
    content: "";
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: var(--sx-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318255c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.35-4.35'/%3E%3C/svg%3E") center / 22px no-repeat;
}

.sx-emptylist p {
    margin: 0;
    padding: 0 !important;
}

.sx-emptylist a {
    color: var(--sx-link);
    font-weight: 500;
}

form fieldset.module a,
form .help a {
    color: var(--sx-link);
}

#content > p,
#content-main > p:only-child {
    margin: 0;
    padding: 24px 28px;
    color: var(--sx-mute);
}

/* a yes / no value in words (unfold/helpers/boolean.html) */
.sx-bool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sx-mute);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

.sx-bool::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sx-bool--yes {
    color: var(--sx-ok);
}

.sx-bool--no {
    color: var(--sx-mute);
}

/* the words drawn by this sheet, in French on a French page */
:lang(fr) .related-lookup::after { content: "Parcourir"; }
:lang(fr) .selector-add::before { content: "Choisir"; }
:lang(fr) .selector-remove::before { content: "Retirer"; }

/* without tabs, the first block of a record page is the form itself, not a tab bar */
body.change-form #content > #content-main {
    padding: 0;
    border-bottom: 0;
    background: none;
}

/* ---------- secondary pages ---------- */

/* delete confirmation */
body.delete-confirmation #content > div[class*="border"] {
    max-width: 760px;
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

body.delete-confirmation #content > div[class*="border"] > p:first-child {
    margin: 0;
    padding: 16px 20px;
    color: var(--sx-ink);
    font-size: 15px;
    font-weight: 600;
}

body.delete-confirmation #content div[class*="border-t"],
body.delete-confirmation #content form[class*="border-t"] {
    padding: 14px 20px;
    border-top: 1px solid var(--sx-line);
}

body.delete-confirmation #content h2 {
    margin: 0 0 6px;
    color: var(--sx-sub);
    font: 600 12.5px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

body.delete-confirmation #content ul {
    color: var(--sx-ink);
    font: 400 13px/1.7 var(--sx-f);
}

body.delete-confirmation #content form {
    display: flex;
    gap: 8px;
}

body.delete-confirmation #content form a,
body.delete-confirmation #content form button,
body.delete-confirmation #content form input[type=submit] {
    display: inline-flex;
    align-items: center;
    height: 34px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-text);
    font-size: 13px;
    font-weight: 500;
}

body.delete-confirmation #content form button[type=submit],
body.delete-confirmation #content form input[type=submit] {
    margin-left: auto;
    border-color: #d92d20;
    background: #d92d20;
    color: #fff;
    font-weight: 600;
}

/* object history and other plain tables */
body:not(.change-list) #content-main > table,
#content > table {
    width: 100%;
    max-width: none;
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

#content > table {
    margin: 20px 28px;
    width: calc(100% - 56px);
}

#content > table th,
#content > table td,
body:not(.change-list) #content-main > table th,
body:not(.change-list) #content-main > table td {
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--sx-dot);
    color: var(--sx-text);
    font: 400 13px var(--sx-f);
}

#content > table thead th,
body:not(.change-list) #content-main > table thead th {
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
    color: var(--sx-sub);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

/* two-list selector (groups, permissions) */
.selector h2 {
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--sx-line);
    background: none;
    color: var(--sx-sub);
    font: 600 12px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

.selector .selector-available,
.selector .selector-chosen {
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    box-shadow: none;
}

.selector p,
.selector .help {
    font-size: 12.5px;
}

form fieldset.module .selector-available-title,
form fieldset.module .selector-chosen-title {
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
}

form fieldset.module .selector-available-title label,
form fieldset.module .selector-chosen-title label {
    margin: 0 0 4px;
    color: var(--sx-sub);
    font: 600 12px/1.2 var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
}

form fieldset.module .selector .helptext {
    margin: 0;
    color: var(--sx-mute);
    font: 400 12.5px var(--sx-f);
}

.selector select,
select[multiple] {
    -webkit-appearance: none;
    appearance: none;
    padding: 4px;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: none;
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
    scrollbar-color: var(--sx-field-h) transparent;
    scrollbar-width: thin;
}

/* a list of several choices on its own: framed like the other fields */
form fieldset.module select[multiple]:not(.selector select) {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
}

form fieldset.module select[multiple]:not(.selector select):focus {
    border-color: var(--sx-btn);
    box-shadow: var(--sx-ring);
}

.selector select option,
select[multiple] option {
    padding: 6px 10px;
    border-radius: 6px;
    background: none;
    color: var(--sx-text);
}

.selector select option:hover,
select[multiple] option:hover {
    background: var(--sx-hover);
    color: var(--sx-ink);
}

.selector select option:checked,
select[multiple] option:checked {
    background: linear-gradient(var(--sx-tint), var(--sx-tint));
    color: var(--sx-link);
    font-weight: 600;
}

/* ---------- small screens ---------- */

@media (max-width: 1279px) {
    .sx-rail-wrap {
        width: 0;
    }

    .sx-rail {
        display: none;
        z-index: 60;
        box-shadow: 0 0 0 100vmax rgba(14, 24, 56, .4);
    }

    .sx-rail-open .sx-rail {
        display: block;
        animation: sx-up .2s ease both;
    }

    .sx-close {
        display: block;
        color: #fff;
    }

    .sx-menu {
        display: inline-flex;
        align-items: center;
        height: 34px;
        padding: 0 12px;
        border: 1px solid var(--sx-field);
        border-radius: var(--sx-r);
        color: var(--sx-text);
        font-weight: 500;
    }

    .sx-bar {
        justify-content: space-between;
    }

    .sx-crumbs {
        display: none;
    }

    #main > .px-4:has(> div > ul.flex-wrap) {
        display: none;
    }
}

@media (max-width: 1023px) {
    #tabs-items {
        flex-wrap: wrap;
        column-gap: 20px;
        row-gap: 0;
    }

    #submit-row {
        position: static;
    }

    #submit-row > div > div {
        flex-wrap: wrap;
        height: auto;
    }

    #submit-row div.mr-auto {
        margin: 0;
    }

    [data-inline-type="tabular"] .formset-wrapper {
        overflow: visible;
    }

    /* the line "will be deleted" keeps Unfold's own display; the empty template stays hidden */
    [data-inline-type="tabular"] table.formset,
    [data-inline-type="tabular"] table.formset tbody:not(.empty-form),
    [data-inline-type="tabular"] table.formset tr:not(.form-delete),
    [data-inline-type="tabular"] table.formset tr:not(.form-delete) > td {
        display: block;
        width: 100%;
    }

    [data-inline-type="tabular"] table.formset tr:not(.form-delete) > td {
        min-height: 0;
        padding: 6px 12px;
    }

    form fieldset.module .form-row:has(input[type=checkbox]) .w-32 {
        width: auto;
        min-width: 0;
    }

    .add-row {
        white-space: normal;
    }
}

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

    .sx-auth::before {
        display: none;
    }

    .sx-auth__head,
    .sx-auth__main,
    .sx-auth__foot {
        grid-column: 1;
    }
}

@media (max-width: 820px) {
    .sx-bar {
        flex-wrap: wrap;
        gap: 8px 14px;
        height: auto;
        min-height: 56px;
        padding: 8px 16px;
    }

    .sx-tools {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .sx-tools > * {
        white-space: nowrap;
    }

    .sx-head {
        padding: 20px 16px 4px;
    }

    #changelist .changelist-form-container,
    form fieldset.module,
    .inline-group,
    #main > .px-4 > div > ul.flex.flex-col {
        margin-left: 16px;
        margin-right: 16px;
    }

    body.change-form #content > div:first-child:has(nav, a),
    #submit-row > div > div,
    .sx-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    #result_list tbody td,
    #result_list tbody th {
        max-width: none;
    }

    #result_list .action-checkbox,
    #result_list .action-checkbox-column {
        width: auto;
    }

    #result_list tbody td::before,
    #result_list tbody th::before {
        color: var(--sx-mute);
        font: 500 12px var(--sx-f);
    }

    .sx-ctl #toolbar {
        flex: 1 1 100%;
        max-width: none;
    }

    .sx-fz {
        flex: 1 1 100%;
    }

    .sx-ctl > .sx-add,
    .sx-ctl .object-tools {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .sx-auth__head,
    .sx-auth__main,
    .sx-auth__foot {
        padding-left: 20px;
        padding-right: 20px;
    }

}

/* ---------- authentication pages: the navy half ---------- */

.sx-auth__side {
    position: relative;
    z-index: 1;
    display: flex;
    grid-column: 1;
    grid-row: 1 / -1;
    flex-direction: column;
    padding: 40px 48px 48px;
    overflow: hidden;
    color: #fff;
}

.sx-auth__side > :not(.login-map) {
    position: relative;
    z-index: 1;
}

/* the world map of the login pages (login_map.html): routes drawn from Paris, a plane on each */
.sx-auth__side .login-map {
    position: absolute;
    top: 44%;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    transform: translateY(-50%);
    animation: sx-fade 1.2s ease-out both;
}

.login-map .land {
    fill: none;
    stroke: rgba(11, 187, 239, .28);
    stroke-width: 3.2;
    stroke-linecap: round;
}

.login-map .route {
    fill: none;
    stroke: var(--sx-cyan);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 0 3px rgba(11, 187, 239, .8));
    animation: sx-route 7.2s var(--d) linear infinite backwards;
}

.login-map .plane {
    fill: #fff;
    filter: drop-shadow(0 0 4px #b4bedb);
    animation: sx-plane 7.2s var(--d) linear infinite backwards;
}

.login-map .dest {
    fill: var(--sx-cyan);
    animation: sx-fade .6s var(--d) ease-out both;
}

.login-map .code {
    fill: rgba(180, 190, 219, .75);
    font: 600 12px var(--sx-f);
    letter-spacing: .06em;
    animation: sx-fade .6s var(--d) ease-out both;
}

.login-map .hub {
    fill: #fff;
}

.login-map .hub-ring {
    fill: none;
    stroke: var(--sx-cyan);
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    animation: sx-ping 2.4s ease-out infinite;
}

.login-map .route-base {
    fill: none;
    stroke: rgba(180, 190, 219, .35);
    stroke-width: 1.6;
}

.login-map .route.route--key {
    stroke: #fff;
    stroke-width: 2.6;
}

.login-map .dest.dest--key,
.login-map .code.code--key {
    fill: #fff;
}

.login-map .code.code--key {
    font-size: 14px;
}

.login-map .hub-ring--key {
    stroke: #fff;
}

@keyframes sx-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sx-route {
    0% { stroke-dashoffset: 1; opacity: 1; }
    55% { stroke-dashoffset: 0; opacity: 1; }
    80% { stroke-dashoffset: 0; opacity: .35; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes sx-plane {
    0% { opacity: 0; }
    3% { opacity: 1; }
    53% { opacity: 1; }
    56%, 100% { opacity: 0; }
}

@keyframes sx-ping {
    0% { transform: scale(1); opacity: .9; }
    100% { transform: scale(4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .login-map .route {
        stroke-dashoffset: 0;
        opacity: .5;
    }

    .login-map .plane {
        display: none;
    }
}

.sx-brand__mark {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.sx-auth__claim {
    max-width: 440px;
    margin: auto 0 0;
    font: 600 34px/1.15 var(--sx-f);
    letter-spacing: -.025em;
    animation: sx-up .5s cubic-bezier(.2, .7, .2, 1) both;
}

.sx-auth__sub {
    max-width: 440px;
    margin: 14px 0 0;
    color: #b4bedb;
    font-size: 15px;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .sx-auth__side {
        display: none;
    }
}

/* Unfold's own notes in a page (an object without history...): a soft card in the page margins */
#content > div[class*="bg-blue-100"],
#content > div[class*="bg-orange-100"],
#content > div[class*="bg-red-100"],
#content > div[class*="bg-green-100"],
#content-main > div[class*="bg-blue-100"],
#content-main > div[class*="bg-orange-100"],
#content-main > div[class*="bg-red-100"],
#content-main > div[class*="bg-green-100"] {
    margin: 20px 28px 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--sx-info-bg);
    color: var(--sx-info);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}

#content > div[class*="bg-orange-100"],
#content-main > div[class*="bg-orange-100"] {
    background: var(--sx-warn-bg);
    color: var(--sx-warn);
}

#content > div[class*="bg-red-100"],
#content-main > div[class*="bg-red-100"] {
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
}

#content > div[class*="bg-green-100"],
#content-main > div[class*="bg-green-100"] {
    background: var(--sx-ok-bg);
    color: var(--sx-ok);
}

body:not(.change-list) #content-main > div[class*="bg-"][class*="-100"] {
    margin: 0 0 16px;
}

/* the admin's own tables (record history, parcel events): values at the top of their row */
.sx-table #result_list tbody td {
    vertical-align: top;
}

/* the admin's own tables with nothing to show: the designed empty state of the lists */
.sx-table > p:only-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px !important;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    color: var(--sx-mute);
    font-size: 13.5px;
    text-align: center;
}

.sx-table > p:only-child::before {
    content: "";
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: var(--sx-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318255c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") center / 22px no-repeat;
}

.dark .sx-emptylist::before,
.dark .sx-table > p:only-child::before {
    filter: invert(1) hue-rotate(180deg);
}

/* a narrow form inside the administration (password change): a card like the others */
#main .sx-slip:not(.sx-slip--wide) {
    max-width: 440px;
    padding: 20px;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

#main .sx-slip:not(.sx-slip--wide) .sx-cell input:not([type=checkbox]) {
    height: 38px;
    border-radius: var(--sx-r);
    font-size: 13.5px;
}

#main .sx-slip:not(.sx-slip--wide) .sx-go {
    height: 38px;
    border-radius: var(--sx-r);
    font-size: 13.5px;
}

/* a done message at the head of its card, with a tick */
.sx-lead--ok {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sx-ink);
    font-weight: 500;
}

.sx-lead--ok::before {
    content: "";
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sx-ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

@media (max-width: 820px) {
    .sx-who__n {
        display: none;
    }
}

/* js/tables.js: a very long value (a whole message) shows two lines, the rest on hover */
#result_list .sx-clip {
    display: -webkit-box;
    min-width: 260px;
    max-width: 560px;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* record pages: the title and its tabs make one white header, the cards sit below on the grey page */
body.change-form .sx-head,
body.delete-confirmation .sx-head {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-card);
}

body.change-form #main:has(#tabs-items) .sx-head {
    padding-bottom: 6px;
    border-bottom: 0;
}

/* sections of a record (fieldsets with a title): a little air between the cards */
/* Unfold stacks the sections in a column with a 24px gap: the gap alone spaces them */
form fieldset.module {
    margin-bottom: 0;
}

form fieldset.module + fieldset.module {
    margin-top: 0;
}

/* Unfold's file field: one frame like the other fields, the file name inside, the upload icon at its end */
form fieldset.module div.border:has(> label > span > input[type=file]) {
    height: 36px;
    border: 1px solid var(--sx-field) !important;
    border-radius: var(--sx-r);
    background: var(--sx-card);
    box-shadow: none;
}

form fieldset.module div.border:has(> label > span > input[type=file]):hover {
    border-color: var(--sx-field-h) !important;
}

form fieldset.module div.border:has(> label > span > input[type=file]) input[type=text] {
    height: 34px;
    border: 0;
    background: none;
    box-shadow: none;
}

form fieldset.module div.border:has(> label > span > input[type=file]) .material-symbols-outlined {
    color: var(--sx-mute);
}

/* lists with tabs (Messages DG & DX / DH7 & DIE): the title and its tabs make one white header,
   the same as on record pages; the list card sits below on the grey page */
body.change-list #main:has(#tabs-items) .sx-head {
    padding-bottom: 6px;
    background: var(--sx-card);
}

body.change-list #tabs-wrapper {
    margin: 0;
    padding: 0 28px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-card);
}

body.change-list #main:has(#tabs-items) #changelist .changelist-form-container {
    margin-top: 20px;
}

@media (max-width: 820px) {
    body.change-list #tabs-wrapper {
        padding: 0 16px;
    }
}

/* ---------- dates and times (cassini/core/widgets.py, js/pickers.js, the same as Shipping) ---------- */

/* text boxes, typed or picked in the calendar and the clock drawn under them, never Django's pop-ins */
input.sx-date,
input.sx-time {
    cursor: text;
}

input.sx-date::placeholder,
input.sx-time::placeholder {
    color: var(--sx-mute);
    opacity: 1;
}

form fieldset.module input.sx-date,
.sx-cell input.sx-date {
    padding-right: 34px;
    background: var(--sx-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7391' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") right 10px center / 16px no-repeat;
}

form fieldset.module input.sx-time,
.sx-cell input.sx-time {
    padding-right: 34px;
    background: var(--sx-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7391' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") right 10px center / 16px no-repeat;
}

/* a date and a time in one cell */
.sx-dt {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

form fieldset.module .sx-dt input.sx-date {
    flex: 1 1 60%;
    width: auto;
    min-width: 0;
}

form fieldset.module .sx-dt input.sx-time {
    flex: 1 1 40%;
    width: auto;
    min-width: 0;
}

/* the panel under the box */
.sx-pick {
    position: fixed;
    z-index: 1000;
    padding: 6px;
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-pop);
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
    user-select: none;
    animation: sx-pop .14s ease both;
}

.sx-pick button {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background .12s, color .12s;
}

.sx-pick__head {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 4px 8px 10px;
}

.sx-pick__title {
    flex: 1;
    min-width: 0;
    font: 600 14px var(--sx-f);
    text-transform: capitalize;
}

.sx-pick__nav {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: var(--sx-mute) !important;
}

.sx-pick__nav:hover {
    background: var(--sx-hover) !important;
    color: var(--sx-ink) !important;
}

.sx-pick__nav::before {
    content: "";
    width: 7px;
    height: 7px;
    border-top: 1.6px solid currentColor;
    border-left: 1.6px solid currentColor;
    transform: translateX(2px) rotate(-45deg);
}

.sx-pick__nav--next::before {
    transform: translateX(-2px) rotate(135deg);
}

.sx-pick__days {
    display: grid;
    grid-template-columns: repeat(7, 36px);
    gap: 2px;
    padding: 0 4px 4px;
}

.sx-pick__wd {
    display: grid;
    place-items: center;
    height: 26px;
    color: var(--sx-mute);
    font: 600 11px var(--sx-f);
    text-transform: uppercase;
}

.sx-pick__day,
.sx-pick__cell {
    position: relative;
    display: grid;
    place-items: center;
    height: 32px;
    color: var(--sx-text) !important;
    font-variant-numeric: tabular-nums;
}

.sx-pick__day.is-out {
    color: var(--sx-field-h) !important;
}

.sx-pick__day:hover,
.sx-pick__day.is-active,
.sx-pick__cell:hover,
.sx-pick__cell.is-active {
    background: var(--sx-hover) !important;
    color: var(--sx-ink) !important;
}

.sx-pick__day.is-today::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--sx-cyan);
    transform: translateX(-50%);
}

.sx-pick__day.is-picked,
.sx-pick__cell.is-picked {
    background: var(--sx-btn) !important;
    color: var(--sx-btnt) !important;
    font-weight: 600;
}

.sx-pick__day.is-picked.is-today::after {
    background: var(--sx-btnt);
}

.sx-pick__clock {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0 12px;
    padding: 6px 6px 4px;
}

.sx-pick__clock .sx-pick__cap {
    padding: 0 0 6px 2px;
    color: var(--sx-mute);
    font: 600 11px var(--sx-f);
    text-transform: uppercase;
}

.sx-pick__hours {
    display: grid;
    grid-template-columns: repeat(6, 36px);
    gap: 2px;
}

.sx-pick__minutes {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    gap: 2px;
    padding-left: 12px;
    border-left: 1px solid var(--sx-line);
}

.sx-pick__foot {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--sx-line);
}

.sx-pick__foot button {
    padding: 7px 10px;
    color: var(--sx-link);
    font: 600 12.5px var(--sx-f);
}

.sx-pick__foot button:hover {
    background: var(--sx-hover);
}

.sx-pick__foot button + button {
    color: var(--sx-mute);
    font-weight: 500;
}


/* ---------- lists and history, as Cassini's ---------- */

/* dates of the lists on one line, even in a list set tighter by js/tables.js */
#result_list tbody td.field-created_date,
#result_list tbody td.field-modified_date,
#result_list tbody td.field-valid_from,
#result_list tbody td.field-_valid_to,
#result_list tbody td.field-status_date,
#result_list tbody td.field-date_joined,
#result_list tbody td.field-last_login {
    white-space: nowrap;
}

/* a list too wide for the page: its column names may take two lines before its values do */
#result_list.sx-dense thead th {
    white-space: normal;
}

/* the change history of a record (Django's object history, drawn by Unfold): a card in the page
   margins, its column names like the lists', the number of entries under it */
#content > div.border:has(> table) {
    width: auto;
    margin: 20px 28px 0;
    overflow: auto;
    border: 1px solid var(--sx-line) !important;
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

#content > div.border:has(> table) table {
    width: 100%;
    border-spacing: 0;
}

#content > div.border:has(> table) thead th {
    padding: 0 16px;
    height: 38px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
    color: var(--sx-sub);
    font: 600 12px var(--sx-f);
    text-align: left;
    text-transform: none;
}

#content > div.border:has(> table) tbody td,
#content > div.border:has(> table) tbody th {
    padding: 11px 16px;
    border-bottom: 1px solid var(--sx-dot);
    color: var(--sx-text);
    font: 400 13px/1.45 var(--sx-f);
    vertical-align: top;
}

#content > div.border:has(> table) tbody tr:last-child td,
#content > div.border:has(> table) tbody tr:last-child th {
    border-bottom: 0;
}

#content > div.border:has(> table) + div[class*="bg-base-50"] {
    margin: 10px 28px 0;
    padding: 0;
    background: none;
    color: var(--sx-mute);
    font-size: 12.5px;
}

@media (max-width: 820px) {
    #content > div.border:has(> table),
    #content > div.border:has(> table) + div[class*="bg-base-50"] {
        margin-left: 16px;
        margin-right: 16px;
    }
}

/* ---------- Shipping ---------- */

[x-cloak] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sx-sec + .sx-sec,
.sx-grp + .sx-sec {
    margin-top: 2px;
}

/* the work waiting for the user: a bell drawn as the theme button of the top bar (ui.css .sx-mode), a
   cyan dot when there is some (the count stays for screen readers and in the list under the bell) */
.sx-bell__b {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--sx-field);
    border-radius: 8px;
    background: var(--sx-card);
    color: var(--sx-text);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}

.sx-bell__b .sx-ico {
    width: 16px;
    height: 16px;
    stroke-width: 1.7;
}

.sx-bell__b:hover,
.sx-bell.is-open .sx-bell__b {
    border-color: var(--sx-field-h);
    background: var(--sx-hover);
}

.sx-bell__b:active {
    transform: translateY(1px);
}

.sx-bell__b i {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--sx-cyan);
    box-shadow: 0 0 0 2px var(--sx-card);
    color: transparent;
    font-size: 0;
}

.sx-bell .sx-amenu {
    min-width: 260px;
}

.sx-bell .sx-amenu a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sx-bell .sx-amenu b {
    flex: none;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--sx-warn-bg);
    color: var(--sx-warn);
    font: 600 12px/22px var(--sx-f);
    text-align: center;
    font-variant-numeric: tabular-nums;
}


/* a record's own tools (history, label) on the line of its title */
.sx-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}

.sx-head h1 {
    flex: 1 1 320px;
    min-width: 0;
}

.sx-head__tools {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* the add link stays in the list's control strip, not on a form */
.sx-head__tools .addlink {
    display: none;
}

.sx-head__tools a,
.sx-head__tools button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--sx-field) !important;
    border-radius: var(--sx-r) !important;
    background: var(--sx-card) !important;
    box-shadow: none !important;
    color: var(--sx-text) !important;
    font: 500 13px var(--sx-f);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s;
}

.sx-head__tools a:hover,
.sx-head__tools button:hover {
    border-color: var(--sx-field-h) !important;
    color: var(--sx-ink) !important;
}

.sx-head__tools .material-symbols-outlined {
    color: var(--sx-mute);
    font-size: 17px;
}

/* ---------- Shipping: login pages, public pages ---------- */

/* the language of the page, beside the theme switch */
.sx-lang a,
.sx-lang button {
    display: inline-block;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--sx-mute);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.sx-lang a:hover {
    color: var(--sx-ink);
}

.sx-lang .on {
    background: var(--sx-card);
    color: var(--sx-ink);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
    cursor: default;
}

.sx-auth__head .sx-tools {
    gap: 10px;
}

.sx-auth .lead + .lead {
    margin-top: 10px;
}

.sx-auth .lead strong {
    color: var(--sx-ink);
    font: 500 14px var(--sx-m);
}

.sx-auth .sx-msg {
    width: 100%;
    max-width: 380px;
}

.sx-cell .sx-code {
    height: 52px;
    font: 500 24px var(--sx-m);
    letter-spacing: .3em;
    text-align: center;
}

.sx-under a {
    color: var(--sx-link);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}

.sx-under a:hover {
    color: var(--sx-link-h);
}

.sx-under--in {
    margin: 0;
    color: var(--sx-mute);
    font-size: 12.5px;
    line-height: 1.6;
}

.sx-under--in button {
    font-size: 12.5px;
}

/* the browser's autofill keeps the colours of the fields */
.sx-cell input:-webkit-autofill,
.sx-cell input:-webkit-autofill:hover,
.sx-cell input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px var(--sx-card) inset;
    -webkit-text-fill-color: var(--sx-ink);
    caret-color: var(--sx-ink);
}

/* strength of a new password, ticked while it is typed */
.sx-strength {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--sx-bg2);
}

.sx-strength__bar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.sx-strength__bar i {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--sx-line);
    transition: background .15s;
}

.sx-strength__bar i.is-on {
    background: var(--sx-btn);
}

.sx-strength__level {
    margin-bottom: 6px;
    color: var(--sx-mute);
    font: 500 12px/1.3 var(--sx-f);
}

.sx-strength__level.is-set {
    color: var(--sx-ink);
}

.strength-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sx-mute);
    font-size: 12.5px;
    line-height: 1.8;
}

.strength-rule::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    margin: 0 4px;
    border-radius: 50%;
    background: var(--sx-field-h);
}

.strength-rule.is-ok {
    color: var(--sx-ink);
}

.strength-rule.is-ok::before {
    width: 14px;
    height: 14px;
    margin: 0;
    background: var(--sx-ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}

.sx-strength__note {
    margin-top: 8px;
    color: var(--sx-mute);
    font-size: 11.5px;
    line-height: 1.5;
}

/* the public tracking page: the form, then the steps of the shipment under it */
.sx-site .sx-account {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--sx-r);
    background: var(--sx-btn);
    color: var(--sx-btnt);
    font: 600 13px var(--sx-f);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}

.sx-site .sx-account:hover {
    background: var(--sx-btn-h);
}

.sx-site .sx-auth__main {
    max-width: 560px;
}

.sx-trk__form .sx-msg {
    width: 100%;
    max-width: 380px;
    margin-top: 16px;
}

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

.sx-trk__result {
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
    animation: sx-up .4s cubic-bezier(.2, .7, .2, 1) both;
}

.sx-trk__route {
    padding: 16px 18px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
}

.sx-trk__legs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--sx-ink);
    font: 600 18px/1.25 var(--sx-f);
    letter-spacing: -.01em;
}

.sx-trk__legs b {
    color: var(--sx-cyan);
    font-weight: 500;
}

.sx-events {
    margin: 0;
    padding: 6px 0;
    list-style: none;
}

.sx-events li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 18px 10px 42px;
    color: var(--sx-mute);
    font-size: 13px;
}

/* a line of dots, one per step: the latest in cyan */
.sx-events li::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 19px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--sx-field-h);
    border-radius: 50%;
    background: var(--sx-card);
}

.sx-events li::after {
    content: "";
    position: absolute;
    top: 30px;
    bottom: -14px;
    left: 24px;
    width: 1px;
    background: var(--sx-line);
}

.sx-events li:last-child::after {
    content: none;
}

.sx-events li:first-child::before {
    border-color: var(--sx-cyan);
    background: var(--sx-cyan);
    box-shadow: 0 0 0 4px var(--sx-info-bg);
}

.sx-events li .sx-cap {
    margin: 0;
}

.sx-events li b {
    color: var(--sx-ink);
    font-size: 14px;
    font-weight: 600;
}

/* embedded by a partner (?embed=1): the form alone, no navy half, head or foot */
.sx-embed .sx-auth {
    display: block;
    min-height: 0;
}

.sx-embed .sx-auth::before,
.sx-embed .sx-auth__side {
    display: none;
}

.sx-embed .sx-auth__main {
    max-width: none;
    padding: 24px;
}

/* a status in words: a soft pill with a dot, coloured by what it means */
.sx-st {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--sx-hover);
    color: var(--sx-sub);
    font: 500 12px var(--sx-f);
    white-space: nowrap;
}

.sx-st::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sx-st--ok { background: var(--sx-ok-bg); color: var(--sx-ok); }
.sx-st--warn { background: var(--sx-warn-bg); color: var(--sx-warn); }
.sx-st--ink { background: var(--sx-info-bg); color: var(--sx-info); }

/* ---------- Shipping: lists ---------- */

/* a reference cell drawn before .ui-refcell (css/ui.css): the customer's reference under it */
#result_list td.field-_reference > div:not(.ui-refcell) {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px !important;
}

#result_list td.field-_reference > div:not(.ui-refcell) > span:first-child {
    color: var(--sx-ink);
    font-weight: 600;
}

/* the badges of the model admins (get_badge_format): soft pills, coloured by what they mean */
#result_list span[class*="ring-inset"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    margin: 0;
    padding: 0 8px !important;
    border: 0;
    border-radius: 999px !important;
    background: var(--sx-hover) !important;
    box-shadow: none !important;
    color: var(--sx-sub) !important;
    font: 500 12px var(--sx-f) !important;
    letter-spacing: 0;
    white-space: nowrap;
}

#result_list span[class*="ring-inset"]::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* a customer reference: a code in a soft frame, no dot */
#result_list td.field-_reference span[class*="ring-inset"][class*="bg-gray"] {
    border-radius: 6px !important;
    font: 500 12px var(--sx-m) !important;
}

#result_list td.field-_reference span[class*="ring-inset"][class*="bg-gray"]::before {
    content: none;
}

#result_list span[class*="ring-inset"][class*="bg-green"] {
    background: var(--sx-ok-bg) !important;
    color: var(--sx-ok) !important;
}

#result_list span[class*="ring-inset"][class*="bg-indigo"] {
    background: var(--sx-warn-bg) !important;
    color: var(--sx-warn) !important;
}

#result_list span[class*="ring-inset"][class*="bg-red"] {
    background: var(--sx-bad-bg) !important;
    color: var(--sx-bad) !important;
}

/* "printed" goes under the status */
#result_list span[class*="ring-inset"][class*="mt-2"] {
    display: flex;
    width: max-content;
    margin-top: 6px !important;
}

/* the tracking link of a reference: a small outlined button, its icon and its name */
#result_list a > span[class*="ring-inset"][class*="bg-primary"] {
    height: 26px;
    padding: 0 9px 0 7px !important;
    border: 1px solid var(--sx-field);
    border-radius: 7px !important;
    background: var(--sx-card) !important;
    color: var(--sx-text) !important;
    transition: border-color .15s, color .15s;
}

#result_list a > span[class*="ring-inset"][class*="bg-primary"]::before {
    content: none;
}

#result_list a:hover > span[class*="ring-inset"][class*="bg-primary"] {
    border-color: var(--sx-field-h);
    color: var(--sx-ink) !important;
}

#result_list span[class*="ring-inset"] .material-symbols-outlined {
    width: auto;
    margin: 0 !important;
    color: var(--sx-mute);
    font-size: 16px;
}

/* the icons the model admins draw in a cell (airports, addresses): quiet, in the text's grey */
#result_list td:not(.field-_actions) > .material-symbols-outlined,
#result_list td:not(.field-_actions) div > .material-symbols-outlined {
    width: auto;
    margin-right: 6px !important;
    color: var(--sx-mute) !important;
    font-size: 15px;
    vertical-align: -3px;
}

/* the addresses of a shipment: a quiet icon before the shipper and the consignee */
#result_list td.field-_address {
    min-width: 170px;
    line-height: 1.6;
}

#result_list td.field-_address .material-symbols-outlined {
    width: auto;
    margin-right: 6px !important;
    color: var(--sx-mute) !important;
    font-size: 15px;
    vertical-align: -3px;
}

/* short values never break inside: network codes, weights, statuses */
#result_list tbody td.field-_network,
#result_list tbody td.field-_parcel_details,
#result_list tbody td.field-_status {
    white-space: nowrap;
}

/* the actions of a row (get_action_format): small outlined buttons, their icon and their name,
   two per line (one on a narrower screen), the destructive ones in red */
#result_list td.field-_actions {
    width: 1%;
}

#result_list td.field-_actions > div,
#result_list td.field-_actions > span {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 4px;
}

#result_list td.field-_actions a {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    height: 28px;
    margin: 0 !important;
    padding: 0 10px 0 8px !important;
    border: 1px solid var(--sx-field);
    border-radius: 7px !important;
    background: var(--sx-card) !important;
    color: var(--sx-text) !important;
    font: 500 12px/1 var(--sx-f);
    letter-spacing: 0;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}

#result_list td.field-_actions a:hover {
    border-color: var(--sx-field-h);
    color: var(--sx-ink) !important;
}

#result_list td.field-_actions a .material-symbols-outlined {
    width: auto;
    color: var(--sx-mute);
    font-size: 16px;
}

#result_list td.field-_actions a[class*="bg-red"],
#result_list td.field-_actions a[class*="bg-red"] .material-symbols-outlined {
    color: var(--sx-bad) !important;
}

#result_list td.field-_actions a[class*="bg-red"]:hover {
    border-color: #f5c2c0;
    background: var(--sx-bad-bg) !important;
}

.dark #result_list td.field-_actions a[class*="bg-red"]:hover {
    border-color: transparent;
}

@media (max-width: 1365px) {
    #result_list td.field-_actions > div,
    #result_list td.field-_actions > span {
        grid-template-columns: max-content;
    }
}

/* the shipments list keeps its columns inside the card from a laptop width on; narrower, the list
   scrolls sideways inside its card */
@media (min-width: 1024px) {
    /* the shipments list keeps its columns inside the card at every width: fixed widths, the route
       takes what is left and cuts long names (css/ui.css .ui-route) */
    body.model-shipment.change-list #result_list {
        table-layout: fixed;
    }

    body.model-shipment.change-list #result_list th.action-checkbox-column { width: 44px; }
    body.model-shipment.change-list #result_list th.column-_created { width: 112px; }
    body.model-shipment.change-list #result_list th.column-_reference { width: 160px; }
    body.model-shipment.change-list #result_list th.column-_product { width: 124px; }
    body.model-shipment.change-list #result_list th.column-_parcel_details { width: 128px; text-align: right; }
    body.model-shipment.change-list #result_list th.column-_status { width: 116px; }
    body.model-shipment.change-list #result_list th.column-_actions { width: 148px; }

    body.model-shipment.change-list #result_list td {
        overflow: hidden;
    }

    body.model-shipment.change-list #result_list th.column-_parcel_details > div {
        justify-content: flex-end;
    }

    body.model-shipment.change-list #result_list td.field-_actions {
        width: auto;
        overflow: visible;
    }

    body.model-shipment.change-list #result_list td.field-_parcel_details {
        text-align: right;
    }

    body.model-shipment.change-list #result_list td.field-_reference .ui-chip {
        justify-self: start;
    }

    body.model-shipment.change-list #result_list td.field-_address {
        min-width: 0;
    }

    /* the actions open a menu over the rows: the list does not clip it (it never scrolls sideways) */
    body.model-shipment.change-list #changelist-form > div.overflow-x-auto,
    body.model-shipment.change-list #changelist .changelist-form-container {
        overflow: visible;
    }

    body.model-shipment.change-list #result_list td.field-_actions > div {
        display: flex;
    }
}

/* the selection bar starts where the menu ends (Unfold places it after its own, wider sidebar) */
#changelist-form > div.fixed {
    inset-inline-start: var(--ui-rail) !important;
}

@media (max-width: 1279px) {
    #changelist-form > div.fixed {
        inset-inline-start: 0 !important;
    }
}

/* ---------- Shipping: record pages ---------- */

/* a line of fields set by the model admin (a tuple of fields) keeps its fields side by side, on
   the whole width of the card; lines of one field share the grid */
form fieldset.module > .aligned > .form-row:has(> .field-line + .field-line) {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px 20px;
}

form fieldset.module > .aligned > .form-row > .field-line {
    min-width: 0;
    margin: 0;
}

form fieldset.module > .aligned > .form-row .form-field,
form fieldset.module > .aligned > .form-row .form-checkbox {
    margin-bottom: 0;
}

/* the cards of a record page: Unfold stacks them in a column, its gap alone spaces them */
body.change-form #content form > div.flex.flex-col.gap-6 {
    gap: 20px;
    padding-top: 20px;
}

body.change-form #content form > div.flex.flex-col.gap-6 fieldset.module,
body.change-form #content form > div.flex.flex-col.gap-6 .inline-group,
body.change-form #content form > div.flex.flex-col.gap-6 #shipment-resume,
body.change-form #content form > div.flex.flex-col.gap-6 .sx-fs-wrap,
body.change-form #content form > div.flex.flex-col.gap-6 .form-rows[x-data*="activeFieldsetTab"] {
    margin-top: 0;
}

/* a cell hidden by the form's script (pickup fields, references) */
form fieldset.module .field-line.sx-off {
    display: none !important;
}

/* the MRN is written in capitals as it is typed (forms.ArticleForm stores it so) */
input[name$="-mrn"] {
    text-transform: uppercase;
}

/* search boxes: without the browser's clear cross */
input[type=search] {
    -webkit-appearance: none;
    appearance: none;
}

input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* numbers: typed, without the browser's arrows */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* autocomplete lists (select2) inside a card: a field like the others, its frame on the selection
   (Unfold frames the container too) */
form fieldset.module .select2-container {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

form fieldset.module .select2-container .select2-selection--single {
    display: flex;
    align-items: center;
    height: 36px !important;
    min-height: 36px;
    padding: 0 30px 0 10px !important;
    background: var(--sx-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7391' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 12px no-repeat !important;
    transition: border-color .15s, box-shadow .15s;
}

form fieldset.module .select2-container .select2-selection--single:hover {
    border-color: var(--sx-field-h) !important;
}

form fieldset.module .select2-container--open .select2-selection--single,
form fieldset.module .select2-container--focus .select2-selection--single {
    border-color: var(--sx-btn) !important;
    box-shadow: var(--sx-ring) !important;
}

form fieldset.module .select2-container .select2-selection__rendered {
    flex: 1;
    min-width: 0;
    padding: 0 !important;
    overflow: hidden;
    color: var(--sx-ink) !important;
    font: 400 13.5px/34px var(--sx-f) !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

form fieldset.module .select2-container .select2-selection__placeholder {
    color: var(--sx-mute) !important;
}

form fieldset.module .select2-container .select2-selection__arrow {
    display: none !important;
}

form fieldset.module .select2-container .select2-selection__clear {
    margin: 0 4px 0 0 !important;
    color: var(--sx-mute);
    font-size: 16px;
}

.select2-dropdown .select2-search__field {
    height: 32px;
    padding: 0 10px !important;
    border: 1px solid var(--sx-field) !important;
    border-radius: 7px !important;
    background: var(--sx-card) !important;
    color: var(--sx-ink) !important;
    font: 400 13px var(--sx-f) !important;
}

.select2-results__option {
    padding: 7px 10px !important;
    border-radius: 6px;
    color: var(--sx-text);
    font: 400 13px var(--sx-f);
}

.select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--sx-hover) !important;
    color: var(--sx-ink) !important;
}

.select2-results__option[aria-selected="true"] {
    background: var(--sx-tint) !important;
    color: var(--sx-link) !important;
    font-weight: 600;
}

/* the related record menu (⋮, js/fields.js): a small button at the end of the field, gone while
   none of its actions can be used */
.related-widget-wrapper > div[hidden] {
    display: none !important;
}

form fieldset.module .related-widget-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

form fieldset.module .related-widget-wrapper > div:not([class]):last-child {
    flex: none;
}

form fieldset.module .related-widget-wrapper > :first-child,
form fieldset.module .related-widget-wrapper > .select2-container {
    min-width: 0;
}

/* the shipments of a manifest are ticked in boxes, not switches */
.sx-manifest-shipments .sx-table input[type=checkbox] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    border: 1.5px solid var(--sx-field-h);
    border-radius: 4px;
    background: var(--sx-card);
}

.sx-manifest-shipments .sx-table input[type=checkbox]::before {
    content: none !important;
    display: none !important;
}

.sx-manifest-shipments .sx-table input[type=checkbox]:checked {
    border-color: var(--sx-btn);
    background: var(--sx-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

form fieldset.module .related-widget-wrapper > div:not([class]):last-child > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border: 1px solid var(--sx-field) !important;
    border-radius: var(--sx-r) !important;
    background: var(--sx-card) !important;
    box-shadow: none !important;
    color: var(--sx-mute) !important;
    transition: border-color .15s, color .15s;
}

form fieldset.module .related-widget-wrapper > div:not([class]):last-child > div:hover {
    border-color: var(--sx-field-h) !important;
    color: var(--sx-ink) !important;
}

/* the menu it opens */
form fieldset.module .related-widget-wrapper > div:not([class]):last-child nav {
    padding: 4px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--sx-card) !important;
    box-shadow: var(--sx-pop) !important;
}

form fieldset.module .related-widget-wrapper > div:not([class]):last-child nav a {
    border-radius: 6px !important;
    color: var(--sx-text) !important;
    font: 400 13px var(--sx-f) !important;
}

form fieldset.module .related-widget-wrapper > div:not([class]):last-child nav a:hover {
    background: var(--sx-hover) !important;
    color: var(--sx-ink) !important;
}

/* collapsible fieldsets (Audit): a title with its chevron, like the other cards */
form fieldset.module details > summary {
    list-style: none;
    cursor: pointer;
}

form fieldset.module details > summary::-webkit-details-marker {
    display: none;
}

form fieldset.module details > summary h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sx-ink);
    font: 600 14px var(--sx-f);
}

form fieldset.module details[open] > summary h2 {
    margin-bottom: 16px;
}

/* forms in tabs (Customer): the tabs as underlined words on the card, like the record tabs */
#content .form-rows[x-data*="activeFieldsetTab"] {
    max-width: none;
    margin: 20px 28px 0;
    overflow: visible;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

#content .form-rows[x-data*="activeFieldsetTab"] > div:first-child {
    margin: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--sx-line);
}

#content .form-rows[x-data*="activeFieldsetTab"] > div:first-child nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 24px;
    padding: 0;
    background: none;
}

#content .form-rows[x-data*="activeFieldsetTab"] > div:first-child nav > a {
    width: auto;
    padding: 13px 0 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--sx-mute);
    font: 500 13px var(--sx-f);
}

#content .form-rows[x-data*="activeFieldsetTab"] > div:first-child nav > a:hover {
    color: var(--sx-ink);
}

#content .form-rows[x-data*="activeFieldsetTab"] > div:first-child nav > a.active {
    border-bottom-color: var(--sx-btn);
    background: none;
    box-shadow: none;
    color: var(--sx-ink);
}

#content .form-rows[x-data*="activeFieldsetTab"] > div:first-child nav > a.active::after {
    content: none;
}

#content .form-rows[x-data*="activeFieldsetTab"] fieldset.module {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
}

/* files (apps/core/widgets.py): one frame like the other fields, a button, then the file's name */
.sx-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    min-width: 0;
}

form fieldset.module label.sx-file__pick,
label.sx-file__pick {
    position: relative;
    display: flex;
    flex: 1 1 260px;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 0 10px 0 4px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-ink);
    font: 400 13px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

label.sx-file__pick:hover {
    border-color: var(--sx-field-h);
}

label.sx-file__pick:focus-within {
    border-color: var(--sx-btn);
    box-shadow: var(--sx-ring);
}

.sx-file__pick input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    clip: rect(0 0 0 0);
}

.sx-file__btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    background: var(--sx-tint);
    color: var(--sx-link);
    font: 500 12.5px var(--sx-f);
    white-space: nowrap;
    transition: background .15s;
}

.sx-file__pick:hover .sx-file__btn {
    background: var(--sx-sel);
}

.sx-file__name {
    min-width: 0;
    overflow: hidden;
    color: var(--sx-mute);
    font: 400 13px var(--sx-f);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sx-file__name.is-chosen {
    color: var(--sx-ink);
    font-weight: 500;
}

.sx-file__open {
    flex: none;
    color: var(--sx-link);
    font: 500 13px var(--sx-f);
    text-decoration: none;
}

.sx-file__open:hover {
    color: var(--sx-link-h);
}

form fieldset.module label.sx-file__clear,
label.sx-file__clear {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--sx-text);
    font: 400 13px var(--sx-f);
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

/* tabular inlines: the title line above a record takes no room when it has no title */
[data-inline-type] tbody tr:not(.form-row) > td[colspan] {
    padding: 0 !important;
    border: 0 !important;
}

/* a read-only formset with no record draws no empty frame */
[data-inline-type] .formset-wrapper > .border:has(> .formset.empty):not(:has(.add-row, tfoot a)) {
    display: none;
}

/* the delete control of a record (Unfold's box), centred on its line */
[data-inline-type] .form-group h3 > div,
[data-inline-type] tbody tr.form-row > td:last-child > div:has(> label, > .delete-template) {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto !important;
}

[data-inline-type] h3 label,
[data-inline-type] tbody td label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    letter-spacing: 0;
    text-transform: none;
}

/* a fieldset is as narrow as the screen: its wide tables scroll inside it, not the page */
form fieldset.module {
    min-width: 0;
}

/* buttons of Shipping's own screens (the tariff dialog, a quote request) */
.sx-btn--ink {
    border-color: var(--sx-btn);
    background: var(--sx-btn);
    color: var(--sx-btnt) !important;
}

.sx-btn--ink:hover {
    border-color: var(--sx-btn-h);
    background: var(--sx-btn-h);
}

.sx-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.sx-btn .material-symbols-outlined {
    font-size: 17px;
}

/* the tables of a record (tariff confirmations, manifest shipments, tariff prices) */
.sx-framed {
    overflow: auto;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    background: var(--sx-card);
}

.sx-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.sx-table thead th {
    height: 38px;
    padding: 0 12px;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-bg2);
    color: var(--sx-sub);
    font: 600 12px/1.2 var(--sx-f);
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    white-space: nowrap;
}

.sx-table td,
.sx-table tbody th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--sx-dot);
    color: var(--sx-text);
    font: 400 13px/1.45 var(--sx-f);
    text-align: left;
    vertical-align: middle;
}

.sx-table tbody th {
    color: var(--sx-ink);
    font-weight: 500;
    white-space: nowrap;
}

.sx-table tbody tr:last-child td,
.sx-table tbody tr:last-child th {
    border-bottom: 0;
}

.sx-table th:first-child,
.sx-table td:first-child {
    padding-left: 16px;
}

.sx-table th:last-child,
.sx-table td:last-child {
    padding-right: 16px;
}

.sx-table tbody tr:hover td,
.sx-table tbody tr:hover th {
    background: var(--sx-hover);
}

.sx-table td b {
    color: var(--sx-ink);
    font-weight: 600;
}

.sx-table td small {
    color: var(--sx-mute);
    font-size: 12px;
}

.sx-table a {
    color: var(--sx-link);
    font-weight: 500;
    text-decoration: none;
}

.sx-table .sx-r,
.sx-table .sx-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sx-table .sx-empty-cell {
    color: var(--sx-field-h);
}

.sx-tablewrap {
    overflow-x: auto;
}

/* the shipments of a manifest: a box to tick, the reference and its state */
.sx-manifest-shipments .sx-table th:first-child,
.sx-manifest-shipments .sx-table td:first-child {
    width: 44px;
    padding-right: 0;
}

.sx-manifest-shipments .sx-table td b {
    margin-right: 10px;
}

.sx-manifest-shipments > .sx-none {
    padding: 28px 16px;
    border: 1px dashed var(--sx-field-h);
    border-radius: 10px;
    text-align: center;
}

/* the price matrix of a tariff grid */
.sx-matrix__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: -6px 0 14px;
    color: var(--sx-mute);
    font-size: 13px;
}

.sx-matrix__meta b {
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--sx-tint);
    color: var(--sx-link);
    font: 600 11.5px/1.4 var(--sx-f);
}

/* ---------- Shipping: the shipment form ---------- */

/* the summary (parcels, articles, tariff): a card on the right of the form, stuck under the head
   while the form scrolls; above the form on narrower screens */
#shipment-resume {
    margin: 20px 28px 0;
}

.ui-sum__in {
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
}

.ui-sum__h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--sx-dot);
    color: var(--sx-ink);
    font: 700 14px/1.45 var(--sx-f);
}

.ui-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--sx-dot);
}

.ui-kpi {
    min-width: 0;
    padding: 12px 16px;
    background: var(--sx-card);
}

.ui-kpi dt {
    overflow: hidden;
    color: var(--sx-mute);
    font: 400 11.5px/1.45 var(--sx-f);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-kpi dt::first-letter {
    text-transform: uppercase;
}

.ui-kpi dd {
    margin: 2px 0 0;
    color: var(--sx-ink);
    font: 500 18px/normal var(--sx-m);
    white-space: nowrap;
}

.ui-kpi dd small {
    color: var(--sx-mute);
    font-size: 12px;
}

.ui-sum__tariff {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    margin: 0;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.45;
}

.ui-sum__tariff dt,
.ui-sum__tariff dd {
    padding: 4px 0;
}

.ui-sum__tariff dt {
    color: var(--sx-text);
}

.ui-sum__tariff dd {
    margin: 0;
    padding-left: 12px;
    color: var(--sx-ink);
    font-family: var(--sx-m);
    text-align: right;
    white-space: nowrap;
}

.ui-sum__tariff dt:nth-last-of-type(1),
.ui-sum__tariff dd:nth-last-of-type(1) {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--sx-line);
    font-weight: 650;
}

.ui-sum__warn {
    display: flex;
    gap: 8px;
    margin: 0 16px 14px;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--sx-warn-bg);
    color: var(--sx-warn);
    font: 500 12.5px/1.4 var(--sx-f);
}

.ui-sum__go {
    padding: 0 16px 16px;
}

.ui-sum__go button {
    width: 100%;
    font-size: 14px;
    border-color: var(--ui-cyan-line);
    background: var(--ui-cyan-bg);
    color: var(--ui-cyan-ink) !important;
}

.ui-sum__go button:hover {
    border-color: var(--ui-cyan-line);
}

.ui-sum__go .material-symbols-outlined {
    font-size: 18px;
}

/* wide screens: the form between the list of its sections (js/ui.js) and the summary */
@media (min-width: 1280px) {
    body.model-shipment.change-form #content form > div.flex.flex-col.gap-6 {
        position: relative;
        padding-right: 352px;
    }

    body.model-shipment.change-form:not(.ui-stepped) #content form > div.flex.flex-col.gap-6 > :not(#shipment-resume) {
        margin-right: 0;
    }

    body.model-shipment.change-form #shipment-resume {
        position: absolute;
        top: 22px;
        right: 28px;
        bottom: 0;
        width: 300px;
        margin: 0;
    }

    body.model-shipment.change-form .ui-sum__in {
        position: sticky;
        top: 120px;
    }
}

/* the reference buttons of the shipment form, on the title line of its first card */
.sx-fs-wrap {
    position: relative;
    margin: 20px 28px 0;
}

.sx-fs-wrap > fieldset.module {
    margin: 0;
}

.sx-fs-tools {
    position: absolute;
    top: 14px;
    right: 20px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.sx-fs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--sx-field);
    border-radius: var(--sx-r);
    background: var(--sx-card);
    color: var(--sx-text);
    font: 500 12.5px var(--sx-f);
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.sx-fs-btn:hover {
    border-color: var(--sx-field-h);
}

.sx-fs-btn--ink {
    border-color: var(--sx-btn);
    background: var(--sx-btn);
    color: var(--sx-btnt);
}

.sx-fs-btn--ink:hover {
    border-color: var(--sx-btn-h);
    background: var(--sx-btn-h);
}

.sx-fs-btn .material-symbols-outlined {
    font-size: 16px;
}

/* the footer: the tariff button, and why Save waits */
#submit-row .sx-tariff-btn {
    gap: 8px;
}

#submit-row .sx-tariff-btn .material-symbols-outlined {
    margin: 0;
    color: var(--sx-cyan);
    font-size: 18px;
}

.sx-tariff-hint {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--sx-r);
    background: var(--sx-warn-bg);
    color: var(--sx-warn);
    font: 500 12.5px var(--sx-f);
}

#submit-row[data-tariff-pending] [name="_save"],
#submit-row[data-tariff-pending] [name="_continue"],
#submit-row[data-tariff-pending] [name="_addanother"] {
    display: none !important;
}

/* the tariff dialog */
.sx-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(14, 24, 56, .45);
    backdrop-filter: blur(2px);
}

.sx-modal__box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-pop);
    animation: sx-pop .18s ease both;
}

.sx-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sx-line);
}

.sx-modal__head h2 {
    margin: 0;
    color: var(--sx-ink);
    font: 600 16px var(--sx-f);
}

.sx-modal__x {
    display: inline-flex;
    padding: 4px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--sx-mute);
    cursor: pointer;
}

.sx-modal__x:hover {
    background: var(--sx-hover);
    color: var(--sx-ink);
}

.sx-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px;
}

.sx-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--sx-line);
    background: var(--sx-bg2);
}

/* the options of the dialog (tariff_options.html) */
.sx-tq {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.sx-tq__opt {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 24px;
    padding: 14px 16px 14px 46px;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.sx-tq__opt:hover {
    border-color: var(--sx-field-h);
}

.sx-tq__opt:has(input:checked) {
    border-color: var(--sx-btn);
    background: var(--sx-sel);
    box-shadow: var(--sx-ring);
}

/* the choice: a round box drawn by the theme */
.sx-tq__opt input {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 16px;
    left: 16px;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid var(--sx-field-h);
    border-radius: 50%;
    background: var(--sx-card);
    cursor: pointer;
}

.sx-tq__opt input:checked {
    border: 5px solid var(--sx-btn);
}

.sx-tq__head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sx-ink);
    font-size: 14px;
}

.sx-tq__head i {
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--sx-tint);
    color: var(--sx-link);
    font: 600 11.5px/1.4 var(--sx-f);
    font-style: normal;
}

.sx-tq__amounts {
    display: grid;
    grid-row: span 2;
    grid-template-columns: auto auto;
    gap: 2px 16px;
    align-self: center;
    color: var(--sx-text);
    font: 400 12.5px var(--sx-f);
    font-variant-numeric: tabular-nums;
}

.sx-tq__amounts > :nth-child(even) {
    text-align: right;
}

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

.sx-tq__opt small {
    color: var(--sx-mute);
    font: 400 12px var(--sx-f);
}

.sx-tq__none {
    padding: 12px 0;
    text-align: center;
}

.sx-tq__none p,
.sx-tq__wait {
    margin: 0 0 16px;
    color: var(--sx-text);
}

.sx-tq__errors {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
    font-size: 13.5px;
    font-weight: 500;
    list-style: none;
}

@media (max-width: 640px) {
    .sx-tq__opt {
        grid-template-columns: 1fr;
    }

    .sx-tq__amounts {
        grid-row: auto;
    }
}

/* ---------- Shipping: the shipment form, as the 2026-11 mock-up (js/shipment_layout.js) ---------- */

/* "Shipment": two groups (References, Service). The columns of the mock-up: the references in thirds,
   type, product and incoterm in 177.6 : 113.4 : 325 of the same width, the pickup fields on the same
   lines; the 14 px gaps are columns of their own so that both rows keep the mock-up's edges */
form fieldset.module > .aligned.ui-shipment-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 177.6fr) 14px minmax(0, 13.7fr) 14px minmax(0, 85.7fr)
        14px minmax(0, 105.7fr) 14px minmax(0, 205.3fr);
    gap: 14px 0;
}

form fieldset.module > .aligned.ui-shipment-grid > .form-row,
form fieldset.module > .aligned.ui-shipment-grid > .form-row:has(> .field-line + .field-line) {
    display: contents;
}

.ui-shipment-grid > .ui-gl,
.ui-shipment-grid .form-row > .ui-gl {
    grid-column: 1 / -1;
}

.ui-shipment-grid .form-row > .ui-gl:not(:first-child) {
    margin-top: 4px;
}

.ui-shipment-grid .field-line { grid-column: span 3; min-width: 0; }
.ui-shipment-grid .field-line[data-field="reference"],
.ui-shipment-grid .field-line[data-field="reference2"] { grid-column: 1 / span 3; }
.ui-shipment-grid .field-line[data-field="customer_reference"],
.ui-shipment-grid .field-line[data-field="reference3"] { grid-column: 5 / span 3; }
.ui-shipment-grid .field-line[data-field="type"],
.ui-shipment-grid .field-line[data-field="pickup_date"] { grid-column: 1 / span 1; }
.ui-shipment-grid .field-line[data-field="product"],
.ui-shipment-grid .field-line[data-field="pickup_open_time"] { grid-column: 3 / span 3; }
.ui-shipment-grid .field-line[data-field="incoterm"] { grid-column: 7 / span 3; }
.ui-shipment-grid .field-line[data-field="pickup_close_time"] { grid-column: 7 / span 1; }
.ui-shipment-grid .field-line[data-field="delivery_info"] { grid-column: 9 / span 1; }

/* numbered by the server (no reference of its own yet): the customer's reference comes first */
@media (min-width: 821px) {
    .ui-shipment-grid:has(.field-line[data-field="reference"].sx-off) .field-line[data-field="customer_reference"] { grid-column: 1 / span 3; }
}

/* the reference buttons: two small outlined buttons at the end of the "References" line */
.ui-gl.ui-gl--tools::after {
    order: 1;
}

.sx-fs-wrap .ui-ref-tools,
.ui-ref-tools {
    position: static;
    order: 2;
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    margin: -8px 0;
    letter-spacing: 0;
    text-transform: none;
}

.ui-ref-tools .sx-fs-btn,
.ui-ref-tools .sx-fs-btn--ink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px 0 9px;
    border: 1px solid var(--sx-line);
    border-radius: 8px;
    background: var(--sx-card);
    box-shadow: none;
    color: var(--sx-text);
    font: 550 12.5px/1 var(--sx-f);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.ui-ref-tools .sx-fs-btn:hover {
    border-color: var(--sx-field-h);
    background: var(--sx-card);
    box-shadow: none;
    color: var(--sx-ink);
    text-decoration: none;
}

.ui-ref-tools .sx-fs-btn:focus-visible {
    outline: 0;
    box-shadow: var(--sx-ring);
}

.ui-ref-tools .sx-fs-btn[aria-pressed="true"] {
    border-color: var(--ui-cyan-line);
    background: var(--ui-cyan-bg);
    color: var(--ui-cyan-ink);
}

.ui-ref-tools .sx-fs-btn .material-symbols-outlined {
    width: 16px;
    overflow: hidden;
    color: var(--sx-mute);
    font-size: 16px;
}

.ui-ref-tools .sx-fs-btn[aria-pressed="true"] .material-symbols-outlined {
    color: inherit;
}

.sx-fs-wrap:has(.ui-ref-tools) > .sx-fs-tools {
    display: none;
}

/* the type of a new shipment: a switch of two */
.ui-has-typeseg .sx-select {
    display: none;
}

.ui-typeseg {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 38px;
    padding: 3px;
    border-radius: 9px;
    background: var(--sx-dot);
}

.ui-typeseg button {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--sx-mute);
    font: 550 14px var(--sx-f);
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.ui-typeseg button.on {
    background: var(--sx-card);
    color: var(--sx-ink);
    box-shadow: 0 1px 3px rgba(15, 23, 51, .12);
}

.ui-typeseg .material-symbols-outlined {
    font-size: 17px;
}

/* where the pickup fields open */
.ui-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 18px;
    padding: 11px 13px;
    border: 1px dashed var(--sx-line);
    border-radius: 10px;
    background: var(--sx-hover);
    color: var(--sx-mute);
    font-size: 12.5px;
    line-height: 1.45;
}

.ui-note[hidden] {
    display: none;
}

.ui-note .material-symbols-outlined {
    font-size: 17px;
}

/* "Route": the shipper and the consignee, two cards and an arrow between them */
fieldset.module > .aligned:has(.field-line[data-field="shipper"]):has(.field-line[data-field="consignee"]) {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 0;
}

fieldset.module > .aligned:has(.field-line[data-field="shipper"]):has(.field-line[data-field="consignee"])::after {
    content: "";
    order: 2;
    align-self: center;
    justify-self: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--sx-line);
    border-radius: 50%;
    background: var(--sx-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa4c0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
    box-shadow: var(--sx-sh);
}

fieldset.module > .aligned > .form-row:has(.field-line.ui-party) {
    display: flex;
}

fieldset.module > .aligned > .form-row > .field-line.ui-party {
    flex: 1;
}

fieldset.module > .aligned > .form-row:has(.field-line[data-field="shipper"]) { order: 1; }
fieldset.module > .aligned > .form-row:has(.field-line[data-field="consignee"]) { order: 3; }

form fieldset.module .field-line.ui-party {
    position: relative;
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 14px 16px 16px;
    border: 1px solid var(--sx-line);
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}

form fieldset.module .field-line.ui-party:hover {
    border-color: var(--sx-field-h);
    box-shadow: var(--sx-sh);
}

form fieldset.module .ui-party label,
form fieldset.module .field-line.ui-party > div:first-child > label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--ui-mute2);
    font: 500 10.5px/normal var(--sx-m);
    letter-spacing: .1em;
    text-transform: uppercase;
}

form fieldset.module .ui-party label::before {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

form fieldset.module .ui-party--from label::before { border: 2px solid var(--ui-indigo); }
form fieldset.module .ui-party--to label::before { background: var(--sx-ok); }

.ui-party.is-set:not(.is-changing) > .ui-party__ctl {
    display: none;
}

.ui-party.is-changing > .ui-party__ctl {
    margin-top: 12px;
}

.ui-party__who {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ui-party__av {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    font: 650 13px var(--sx-f);
}

.ui-party--from .ui-party__av { background: linear-gradient(135deg, #6366f1, #3b3fb8); }
.ui-party--to .ui-party__av { background: linear-gradient(135deg, #10b981, #0b7a57); }

.ui-party__nm {
    color: var(--sx-ink);
    font-weight: 650;
}

.ui-party__ct {
    color: var(--sx-mute);
    font-size: 12.5px;
    line-height: 1.45;
}

.ui-party__dl {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 5px 10px;
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.ui-party__dl dt {
    color: var(--ui-mute2);
}

.ui-party__dl dt::first-letter {
    text-transform: uppercase;
}

.ui-party__dl dd {
    margin: 0;
    color: var(--sx-text);
    overflow-wrap: anywhere;
}

.ui-party__dl dd.ui-mono {
    font-family: var(--sx-m);
}

.ui-btn.ui-party__chg {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 28px;
    padding: 0 9px;
}

/* "Parcels": a table without frame, a number for each line, the totals under it */
#parcels-group .formset-wrapper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

#parcels-data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: none;
}

/* five measures of the same width between the number and the bin (no bin on a read-only record);
   on a phone Unfold shows each parcel as a small card of its own and the numbers are not needed */
@media (min-width: 1024px) {
    #parcels-data {
        table-layout: fixed;
    }

    #parcels-data thead th[class*="column-"] {
        width: calc((100% - 76px) / 5);
    }
}

@media (max-width: 1023px) {
    #parcels-data .ui-idx {
        display: none;
    }

    /* Unfold stacks the table on a phone: its foot (the totals, the add button) takes the whole width */
    #parcels-data > tfoot,
    #parcels-data > tfoot > tr,
    #parcels-data > tfoot > tr > td {
        display: block;
        width: 100%;
    }

    #parcels-data > tfoot.ui-ptotals > tr {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 16px;
        padding-top: 10px;
        border-top: 1px solid var(--sx-dot);
    }

    #parcels-data > tfoot.ui-ptotals > tr > td {
        width: auto;
        padding: 0;
        border: 0;
    }

    #parcels-data > tfoot.ui-ptotals > tr > td:empty {
        display: none;
    }
}

#parcels-data thead th {
    height: auto;
    padding: 0 6px 8px;
    border: 0;
    background: none;
    color: var(--ui-mute2);
    font: 500 10.5px/normal var(--sx-m);
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

#parcels-data thead th .material-symbols-outlined {
    display: none;
}

#parcels-data thead th {
    vertical-align: bottom;
    white-space: normal;
}

#parcels-data thead th > span {
    display: block;
}

#parcels-data thead th > span > span {
    display: inline;
}

/* the measures: figures on the right, their unit inside the box */
#parcels-data tbody input {
    font-family: var(--sx-m);
    text-align: right;
}

#parcels-data tbody td:has(input[name$="-weight"]) > div,
#parcels-data tbody td:has(input[name$="-length"]) > div,
#parcels-data tbody td:has(input[name$="-width"]) > div,
#parcels-data tbody td:has(input[name$="-height"]) > div {
    position: relative;
}

#parcels-data tbody td:has(input[name$="-weight"]) input,
#parcels-data tbody td:has(input[name$="-length"]) input,
#parcels-data tbody td:has(input[name$="-width"]) input,
#parcels-data tbody td:has(input[name$="-height"]) input {
    padding-right: 34px;
}

#parcels-data tbody td:has(input[name$="-weight"]) > div::after,
#parcels-data tbody td:has(input[name$="-length"]) > div::after,
#parcels-data tbody td:has(input[name$="-width"]) > div::after,
#parcels-data tbody td:has(input[name$="-height"]) > div::after {
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--ui-mute2);
    font: 500 12px/1 var(--sx-m);
    pointer-events: none;
    transform: translateY(-50%);
}

#parcels-data tbody td:has(input[name$="-weight"]) > div::after { content: "kg"; }
#parcels-data tbody td:has(input[name$="-length"]) > div::after,
#parcels-data tbody td:has(input[name$="-width"]) > div::after,
#parcels-data tbody td:has(input[name$="-height"]) > div::after { content: "cm"; }

#parcels-data th.ui-idx,
#parcels-data td.ui-idx {
    width: 34px;
    padding: 4px 0;
    color: var(--ui-mute2);
    font: 500 12px var(--sx-m);
    text-align: center;
}

#parcels-data thead th:last-child:not([class*="column-"]) {
    width: 42px;
}

#parcels-data tbody td {
    min-height: 0;
    padding: 4px 6px;
    border: 0;
    background: none;
}

#parcels-data tbody tr {
    border: 0;
    background: none;
}

#parcels-data input {
    height: 34px;
}

/* narrower screens: the titles of the measures hold in their column */
@media (max-width: 1439px) {
    #parcels-data thead th {
        padding-right: 0;
        letter-spacing: .03em;
    }
}

/* the measures shrink with their column (Unfold gives an input 80 px at least) */
#parcels-data tbody td > div,
#parcels-data tbody td > div > div,
#parcels-data tbody input {
    min-width: 0;
}

#parcels-data tbody td:last-child label,
#parcels-data tbody td:last-child a {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    border-radius: 7px;
    color: var(--ui-mute2);
}

#parcels-data tbody td:last-child .material-symbols-outlined {
    color: inherit !important;
    font-size: 18px;
}

#parcels-data tbody td:last-child label:hover,
#parcels-data tbody td:last-child a:hover {
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
}

.ui-ptotals td {
    padding: 10px 6px 4px;
    border-top: 1px solid var(--sx-dot);
    color: var(--sx-ink);
    font: 500 12.5px var(--sx-m);
}

.ui-ptotals td.ui-sub {
    color: var(--sx-mute);
    font-family: var(--sx-m);
}

#parcels-group .form-actions,
#articles-group .form-actions,
#documents-group .form-actions {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
}

/* "Articles": each article a card, its fields in three groups */
#articles-group .formset-wrapper > div.border,
#documents-group .formset-wrapper > div.border {
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: none;
}

#articles-group .formset,
#documents-group .formset {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: none;
    counter-reset: article;
}

#articles-group .form-group:not(.empty-form) {
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: 12px;
    counter-increment: article;
}

#articles-group .form-group > .form-row {
    border: 0;
}

#articles-group h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 11px 14px;
    border-bottom: 1px solid var(--sx-dot);
    background: var(--sx-bg2);
}

#articles-group h3 > span:first-child::before {
    content: counter(article);
    display: inline-flex;
    align-items: center;
    height: 20px;
    margin-right: 10px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--sx-dot);
    color: var(--sx-mute);
    font: 500 11.5px var(--sx-m);
}

#articles-group h3 strong {
    color: var(--sx-ink);
    font-weight: 600;
}

#articles-group h3 label:hover,
#documents-group h3 label:hover {
    background: var(--sx-bad-bg);
}

form [data-inline-type="stacked"] fieldset.module fieldset.module:has(.ui-article-grid) {
    margin: 0;
    padding: 14px;
    border: 0;
}

form [data-inline-type="stacked"] fieldset.module fieldset.module:has(.ui-article-grid)::before {
    content: none;
}

form fieldset.module .aligned.ui-article-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

form fieldset.module .aligned.ui-article-grid > .form-row,
form fieldset.module .aligned.ui-article-grid > .form-row:has(> .field-line + .field-line) {
    display: contents;
}

.ui-article-grid .ui-gl { grid-column: 1 / -1; }
.ui-article-grid .ui-gl:not(:first-child) { margin-top: 4px; }
.ui-article-grid .field-line { grid-column: span 3; min-width: 0; padding: 0; border: 0; }
.ui-article-grid .field-line[data-field="goods_description"] { grid-column: span 8; }
.ui-article-grid .field-line[data-field="nomenclature"] { grid-column: span 4; }
.ui-article-grid .field-line[data-field="country_manufacturer"],
.ui-article-grid .field-line[data-field="packaging"],
.ui-article-grid .field-line[data-field="mrn"] { grid-column: span 4; }

/* the weights of an article: the unit inside the box */
.ui-article-grid .field-line[data-field$="_weight"] div:has(> input) {
    position: relative;
}

.ui-article-grid .field-line[data-field$="_weight"] input,
.ui-article-grid .field-line[data-field="invoice_value"] input {
    padding-right: 34px;
    font-family: var(--sx-m);
    text-align: right;
}

.ui-article-grid .field-line[data-field="invoice_value"] input {
    padding-right: 12px;
}

.ui-article-grid .field-line[data-field$="_weight"] div:has(> input)::after {
    content: "kg";
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--ui-mute2);
    font: 500 12px/1 var(--sx-m);
    pointer-events: none;
    transform: translateY(-50%);
}

/* the checks the server makes on save, shown while the form is filled */
.ui-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.ui-ck {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border-radius: 8px;
    font: 550 12.5px var(--sx-f);
    transition: background .2s, color .2s;
}

.ui-ck .material-symbols-outlined {
    font-size: 16px;
}

.ui-ck--ok { background: var(--sx-ok-bg); color: var(--sx-ok); }
.ui-ck--ko { background: var(--sx-bad-bg); color: var(--sx-bad); }

/* "Documents": one line each, type, name, file and the bin */
#documents-group .form-group:not(.empty-form) > .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: end;
    gap: 12px;
    border: 0;
}

#documents-group .form-group > .form-row > h3 {
    order: 2;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

#documents-group .form-group > .form-row > h3 > span:first-child {
    display: none;
}

#documents-group .form-group > .form-row > fieldset.module {
    order: 1;
    margin: 0;
    padding: 0;
    border: 0;
}

#documents-group .form-group > .form-row > fieldset.module::before {
    content: none;
}

/* type and name on a line, the file under them the whole width: the same as a document added to a
   shipment already in Cassini (documents_add.html) */
#documents-group .form-group > .form-row > fieldset.module > .aligned {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 12px 14px;
}

#documents-group .form-group > .form-row > fieldset.module > .aligned [data-field="file"] {
    grid-column: 1 / -1;
}

#documents-group .form-group > .form-row > fieldset.module > .aligned > .form-row {
    display: contents;
}

/* a shipment in Cassini: beside the file, whether Cassini has it */
#documents-group .form-group > .form-row > fieldset.module > .aligned:has([data-field="cassini_state"]) [data-field="file"] {
    grid-column: 1;
}

#documents-group [data-field="cassini_state"] .readonly {
    display: flex;
    align-items: center;
    min-height: var(--ui-h);
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

#documents-group .field-line {
    min-width: 0;
    padding: 0;
    border: 0;
}

/* the save bar: the unsaved changes on the left, then delete, calculate, save */
body.model-shipment #submit-row > div > div.flex {
    gap: 10px;
}

body.model-shipment #submit-row [name="_save"] { order: 0; }
body.model-shipment #submit-row #tariff-compute { order: 1; }
body.model-shipment #submit-row .sx-tariff-hint { order: 2; }
body.model-shipment #submit-row a[href*="/delete/"],
body.model-shipment #submit-row .deletelink { order: 3; margin-right: 0 !important; }
body.model-shipment #submit-row .ui-dirty { order: 4; margin-right: auto; }
body.model-shipment #submit-row div.mr-auto { order: 3; margin-right: 0; }

body.model-shipment #submit-row a[href*="/delete/"],
body.model-shipment #submit-row .deletelink {
    border: 1px solid var(--ui-red-line) !important;
    background: var(--sx-card) !important;
}

body.model-shipment #submit-row #tariff-compute {
    border-color: var(--ui-cyan-line);
    background: var(--ui-cyan-bg);
    color: var(--ui-cyan-ink);
}

body.model-shipment #submit-row #tariff-compute .material-symbols-outlined {
    color: inherit;
}

.ui-kpi--wide {
    grid-column: span 2;
}

@media (max-width: 820px) {
    form fieldset.module > .aligned.ui-shipment-grid,
    form fieldset.module .aligned.ui-article-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ui-shipment-grid .field-line,
    .ui-shipment-grid .field-line[data-field],
    .ui-shipment-grid .ui-ref-tools,
    .ui-article-grid .field-line,
    .ui-article-grid .field-line[data-field] {
        grid-column: 1 / -1;
    }

    fieldset.module > .aligned:has(.field-line[data-field="shipper"]):has(.field-line[data-field="consignee"]) {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    fieldset.module > .aligned:has(.field-line[data-field="shipper"]):has(.field-line[data-field="consignee"])::after {
        transform: rotate(90deg);
    }

    #documents-group .form-group > .form-row > fieldset.module > .aligned {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* the title of a shipment is its reference: a code */
body.model-shipment.change-form .sx-head h1 {
    font-family: var(--sx-m);
}

body.model-shipment.change-form .sx-head h1 > span {
    display: none;
}

/* ---------- Shipping: pages of their own (confirmations, tracking, import) ---------- */

/* a question and its answer buttons in one card (confirm_action.html and the like) */
.sx-confirm {
    max-width: 760px;
    overflow: hidden;
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-rc);
    background: var(--sx-card);
    box-shadow: var(--sx-sh);
    animation: sx-up .35s cubic-bezier(.2, .7, .2, 1) both;
}

.sx-confirm--wide {
    max-width: none;
}

.sx-confirm__q {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0;
    padding: 16px 20px;
    color: var(--sx-ink);
    font-size: 15px;
    font-weight: 600;
}

.sx-confirm__b {
    padding: 16px 20px;
    border-top: 1px solid var(--sx-line);
}

.sx-confirm__b h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--sx-sub);
    font: 600 12.5px var(--sx-f);
}

.sx-count {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--sx-tint);
    color: var(--sx-link);
    font: 600 11.5px var(--sx-f);
}

.sx-confirm__f {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--sx-line);
    background: var(--sx-bg2);
}

.sx-confirm__f > :last-child:not(:first-child) {
    margin-left: auto;
}

.sx-confirm__f p {
    margin: 0;
}

.sx-confirm__f input[type=submit],
body.delete-confirmation #content .sx-confirm__f input[type=submit] {
    min-width: 120px;
    margin-left: 0;
    border-color: var(--sx-btn);
    background: var(--sx-btn);
    color: var(--sx-btnt) !important;
    font-weight: 600;
}

.sx-confirm__f input[type=submit]:hover,
body.delete-confirmation #content .sx-confirm__f input[type=submit]:hover {
    border-color: var(--sx-btn-h);
    background: var(--sx-btn-h);
}

/* a dot before a yes / no value */
.sx-yes,
.sx-no {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
}

.sx-yes::before,
.sx-no::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sx-yes { color: var(--sx-ok); }
.sx-no { color: var(--sx-mute); }

/* the steps of a shipment in the administration (tracking.html) */
.sx-confirm .sx-trk__route {
    margin: -16px -20px 0;
}

.sx-confirm .sx-events {
    margin: 0 -20px -16px;
}

@media (max-width: 820px) {
    .sx-confirm__q,
    .sx-confirm__b,
    .sx-confirm__f {
        padding-left: 16px;
        padding-right: 16px;
    }

    .sx-confirm .sx-trk__route {
        margin: -16px -16px 0;
    }

    .sx-confirm .sx-events {
        margin: 0 -16px -16px;
    }
}

/* ---------- Shipping: small screens ---------- */

/* the shipment summary under 960 px: its three blocks one under the other */
@media (max-width: 960px) {
    #shipment-resume {
        grid-template-columns: minmax(0, 1fr);
    }

    .sx-resume__block {
        border-top: 1px solid var(--sx-line);
        border-left: 0;
    }

    .sx-resume__block:first-child {
        border-top: 0;
    }
}

@media (max-width: 820px) {
    /* on a phone the summary of a shipment scrolls with the page: stuck, it would hide the form */
    #shipment-resume,
    .sx-fs-wrap,
    #content .form-rows[x-data*="activeFieldsetTab"] {
        position: static;
        margin-left: 16px;
        margin-right: 16px;
    }

    .sx-fs-wrap {
        position: relative;
    }
}

/* on a phone the reference buttons go under the name of their group, side by side */
@media (max-width: 640px) {
    .ui-gl.ui-gl--tools {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .ui-gl--tools > .ui-ref-tools {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin: 0;
    }

    .ui-gl--tools > .ui-ref-tools .sx-fs-btn {
        justify-content: center;
        height: 34px;
    }
}

/* the reference buttons of the shipment form on a phone: one line of two buttons above the form */
@media (max-width: 640px) {
    .sx-fs-tools {
        position: static;
        margin-bottom: 12px;
    }

    .sx-fs-btn {
        flex: 1 1 0;
        justify-content: center;
        height: auto;
        min-height: 36px;
        padding: 6px 10px;
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }

    .sx-dates:not(.hidden) {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------- Shipping: additions to the shared pieces ---------- */

/* the name of the application on the navy half: a link to the home page */
a.sx-brand__mark {
    color: #fff;
    text-decoration: none;
}

/* on a small screen the navy half is gone: the name of the application heads the page */
.sx-auth__brand {
    display: none;
    margin-right: auto;
    color: var(--sx-ink);
    font: 600 18px var(--sx-f);
    letter-spacing: -.01em;
    text-decoration: none;
}

@media (max-width: 900px) {
    .sx-auth__head {
        justify-content: space-between;
        gap: 12px;
    }

    .sx-auth__brand {
        display: block;
    }
}

/* the help of a field on a form page, under its value */
.sx-help {
    display: block;
    margin-top: 6px;
    color: var(--sx-mute);
    font: 400 12px/1.45 var(--sx-f);
}

/* the buttons at the foot of a form page: Cancel, then the action */
.sx-slip__foot {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 8px;
}

.sx-slip--wide .sx-slip__foot .sx-go {
    width: auto;
    min-width: 140px;
    height: 34px;
    padding: 0 18px;
    border-radius: var(--sx-r);
    font-size: 13px;
}

.sx-slip--wide .sx-slip__foot .sx-btn {
    height: 34px;
}

/* the manifest to choose, beside the answer */
.sx-confirm__pick {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}

.sx-confirm__pick .sx-cell {
    min-width: 260px;
}

.sx-confirm .sx-msg {
    width: auto;
    margin: 0;
}

.sx-confirm .sx-none {
    margin: 0;
}

/* the notes of a form with errors (Unfold's errornote): a soft red card */
.errornote {
    padding: 12px 16px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--sx-bad-bg) !important;
    color: var(--sx-bad) !important;
    font: 500 13.5px/1.45 var(--sx-f);
}

body.change-form #content p.errornote {
    margin: 20px 28px 0 !important;
}

@media (max-width: 820px) {
    body.change-form #content p.errornote {
        margin-left: 16px !important;
        margin-right: 16px !important;
    }
}

body.sx-embed {
    background: var(--sx-card);
}

/* Unfold's notes at the head of a form (adding a user...): a soft card in the page margins */
body.change-form #content form > div[class*="bg-blue-100"],
body.change-form #content form > div[class*="bg-orange-100"],
body.change-form #content form > div[class*="bg-green-100"] {
    margin: 20px 28px 0;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--sx-info-bg);
    color: var(--sx-info);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}

body.change-form #content form > div[class*="bg-orange-100"] {
    background: var(--sx-warn-bg);
    color: var(--sx-warn);
}

body.change-form #content form > div[class*="bg-green-100"] {
    background: var(--sx-ok-bg);
    color: var(--sx-ok);
}

@media (max-width: 820px) {
    body.change-form #content form > div[class*="bg-"][class*="-100"] {
        margin-left: 16px;
        margin-right: 16px;
    }
}

/* the delete page: its answers take the width of the card, Yes at the right end */
body.delete-confirmation #content form:not(.sx-confirm__f) > div {
    flex: 1 1 auto;
}

/* the public tracking page on a phone: the name on its line, the account link and the switches under it */
@media (max-width: 520px) {
    .sx-site .sx-auth__head {
        flex-wrap: wrap;
    }

    .sx-site .sx-auth__head .sx-tools {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .sx-site .sx-auth__head .sx-account {
        margin-right: auto;
    }
}

/* a table of records drawn as a column on a small screen: each value under the name of its field */
.sx-tlabel {
    display: none;
}

@media (max-width: 1023px) {
    .sx-tlabel {
        display: block;
        margin-bottom: 6px;
        color: var(--sx-sub);
        font: 500 12px/1.3 var(--sx-f);
    }

    [data-inline-type="tabular"] table.formset thead {
        display: none;
    }
}

/* a text with its formatting (Unfold's trix editor): the whole line, framed like a text box */
form fieldset.module > .aligned > .form-row:has(trix-editor) {
    grid-column: 1 / -1;
}

form fieldset.module trix-editor {
    min-height: 110px;
    padding: 8px 10px;
    border: 1px solid var(--sx-field) !important;
    border-radius: var(--sx-r) !important;
    background: var(--sx-card);
    box-shadow: none !important;
    color: var(--sx-ink);
    font: 400 13.5px/1.5 var(--sx-f);
    transition: border-color .15s, box-shadow .15s;
}

form fieldset.module trix-editor:focus {
    border-color: var(--sx-btn) !important;
    box-shadow: var(--sx-ring) !important;
    outline: 0;
}

/* ---------- a document added to a shipment in Cassini (documents_add.html), each one's state ---------- */

.sx-doc-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font: 500 12px/18px var(--sx-f);
    white-space: nowrap;
}

.sx-doc-state::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sx-doc-state.is-sent {
    background: var(--sx-ok-bg);
    color: var(--sx-ok);
}

.sx-doc-state.is-todo {
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
}

.sx-doc-add {
    margin: 4px 0 0;
    padding: 16px 0 4px;
    border-top: 1px dashed var(--sx-field-h);
}

.sx-doc-add__late {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: var(--ui-rf);
    background: var(--sx-bad-bg);
    color: var(--sx-bad);
    font: 500 13px var(--sx-f);
}

.sx-doc-add__late > span:nth-child(2) {
    flex: 1;
}

.sx-doc-add__late .material-symbols-outlined {
    font-size: 18px;
}

.sx-doc-add__late .sx-btn,
.sx-doc-add__go {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
}

.sx-doc-add__late .sx-btn .material-symbols-outlined,
.sx-doc-add__go .material-symbols-outlined {
    font-size: 17px;
}

.sx-doc-add__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-bottom: 12px;
}

.sx-doc-add__head b {
    color: var(--sx-ink);
    font: 600 14px var(--sx-f);
}

.sx-doc-add__head span {
    color: var(--sx-mute);
    font-size: 12.5px;
}

/* type and name, then the file the whole width, then the button: the section is narrow beside the summary */
.sx-doc-add__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: end;
    gap: 12px 14px;
    /* the column of the bin of the documents above: the fields line up with theirs */
    padding-right: 46px;
}

.sx-doc-add__field:has(input[type="file"]) {
    grid-column: 1 / -1;
}

.sx-doc-add__field label {
    display: block;
    margin-bottom: 6px;
    color: var(--sx-sub);
    font: 500 12.5px var(--sx-f);
}

.sx-doc-add__field > input,
.sx-doc-add__field > select {
    width: 100%;
}

.sx-doc-add__go {
    grid-column: 1 / -1;
    justify-self: end;
    height: var(--ui-h);
}

@media (max-width: 900px) {
    .sx-doc-add__fields {
        grid-template-columns: 1fr;
        padding-right: 0;
    }

    .sx-doc-add__late {
        flex-wrap: wrap;
    }
}

/* the search box of the top bar and the labels of the supervision page (its search, its drawer):
   the form labels of this project (src/css/styles.css: block, medium, small text, 8px under) stay
   out of them */
.sx-find__box,
.sv label {
    margin-bottom: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}
