/*
 * Components of the design system, built on the tokens of tokens.css.
 *
 * The class names follow the Bootstrap vocabulary on purpose. A form theme or a template
 * that renders Bootstrap 5 names needs no new markup. Only the classes the products use
 * are defined. A product loads no Bootstrap.
 *
 * Sections: grid, layout and utilities, buttons, alerts, forms, cards, badges, tables,
 * list groups, tabs, modal.
 * The header of a page is the top bar of the app shell: shell.css.
 *
 * Source: design-system/styles/ in the _conventions repository. A copy in a product
 * repository is a derived file. Change the rule there first, then run the sync script.
 */

/* ---------------------------------------------------------------- Grid */

/* The grid comes before the utility classes, so a utility class on a column wins.
   A row is a flex container with twelve columns. The gutter class (g-2 to g-4) sets the
   space between the columns and between the lines. A column without a breakpoint class
   takes the full width, so each column stacks on a narrow screen.
   Breakpoints: sm 576px, md 768px, lg 992px. */
.row {
    --gutter-x: var(--space-4);
    --gutter-y: 0px;
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--gutter-y));
    margin-right: calc(-.5 * var(--gutter-x));
    margin-left: calc(-.5 * var(--gutter-x));
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    margin-top: var(--gutter-y);
    padding-right: calc(.5 * var(--gutter-x));
    padding-left: calc(.5 * var(--gutter-x));
}
.g-0 { --gutter-x: 0px; --gutter-y: 0px; }
.g-2 { --gutter-x: var(--space-2); --gutter-y: var(--space-2); }
.g-3 { --gutter-x: var(--space-3); --gutter-y: var(--space-3); }
.g-4 { --gutter-x: var(--space-4); --gutter-y: var(--space-4); }
.col { flex: 1 0 0%; }
.col-1 { flex: 0 0 auto; width: 8.33333%; }
.col-2 { flex: 0 0 auto; width: 16.6667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.3333%; }
.col-5 { flex: 0 0 auto; width: 41.6667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.3333%; }
.col-8 { flex: 0 0 auto; width: 66.6667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }
@media (min-width: 576px) {
    .col-sm { flex: 1 0 0%; }
    .col-sm-1 { flex: 0 0 auto; width: 8.33333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
    .col-md { flex: 1 0 0%; }
    .col-md-1 { flex: 0 0 auto; width: 8.33333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 992px) {
    .col-lg { flex: 1 0 0%; }
    .col-lg-1 { flex: 0 0 auto; width: 8.33333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}


/* ---------------------------------------------------------------- Layout and utilities */

.container { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 var(--space-3); }
.container-wide { max-width: 72rem; }

.d-block { display: block; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.me-2 { margin-right: var(--space-2); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.me-1 { margin-right: var(--space-1); }
.ms-2 { margin-left: var(--space-2); }
.m-3 { margin: var(--space-3); }
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.ps-3 { padding-left: var(--space-3); }
.d-grid { display: grid; }
.flex-nowrap { flex-wrap: nowrap; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-end { justify-content: flex-end; }
.align-top { vertical-align: top; }
.text-end { text-align: right; }
.text-secondary { color: var(--ink-2); }
.text-danger { color: var(--danger); }
.h6 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.border { border: 1px solid var(--line); }
.border-top-0 { border-top: 0; }
.rounded { border-radius: var(--radius-field); }
.rounded-bottom { border-bottom-right-radius: var(--radius-field); border-bottom-left-radius: var(--radius-field); }
.bg-light-subtle { background: var(--white); }
/* A script hides an element with d-none, also when another class of the element sets a display. */
.d-none { display: none !important; }

/* A class with a breakpoint (md, lg) comes after the class without one, so it wins from that width up. */
@media (min-width: 768px) {
    .justify-content-md-end { justify-content: flex-end; }
}
@media (min-width: 992px) {
    .mt-lg-4 { margin-top: var(--space-4); }
    .pt-lg-2 { padding-top: var(--space-2); }
    .mb-lg-0 { margin-bottom: 0; }
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------- Buttons */

/* A variant class sets the custom properties. Hover and focus work for every variant. */
.btn {
    --btn-bg: var(--ink);
    --btn-fg: var(--paper);
    --btn-border: var(--btn-bg);
    --btn-hover-bg: #2C322B;
    --btn-hover-fg: var(--btn-fg);
    --btn-sheen: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%);
    --btn-shadow: 0 1px 2px rgba(19, 22, 19, .2), 0 5px 12px -4px rgba(19, 22, 19, .4), inset 0 1px 0 rgba(255, 255, 255, .16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: .65rem 1.4rem;
    border: 1.5px solid var(--btn-border);
    border-radius: var(--radius-pill);
    background-color: var(--btn-bg);
    background-image: var(--btn-sheen);
    box-shadow: var(--btn-shadow);
    color: var(--btn-fg);
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.btn:hover {
    background-color: var(--btn-hover-bg);
    border-color: var(--btn-hover-bg);
    color: var(--btn-hover-fg);
    text-decoration: none;
    transform: translateY(-1px);
}
/* Pressed: the button sinks into the page. */
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-inset); }
.btn:focus-visible { box-shadow: var(--btn-shadow), var(--ring); }
.btn:disabled,
.btn[disabled],
.btn.disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}
.btn-sm { padding: .35rem .9rem; font-size: .875rem; }
.btn-lg { padding: .9rem 1.9rem; font-size: 1.15rem; }

.btn-primary { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-hover-bg: #2C322B; }
.btn-secondary {
    --btn-bg: var(--white);
    --btn-fg: var(--ink);
    --btn-border: var(--line);
    --btn-hover-bg: #FAFAF8;
    --btn-sheen: var(--surface-raised);
    --btn-shadow: var(--shadow-raised-sm);
}
.btn-secondary:hover { border-color: var(--line-strong); }
/* The accent button is the one place where mint is a button surface. */
.btn-accent { --btn-bg: var(--mint); --btn-fg: var(--ink); --btn-hover-bg: #5BE8B5; --btn-shadow: 0 1px 2px rgba(19, 22, 19, .12), 0 5px 12px -4px rgba(54, 224, 160, .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-success { --btn-bg: var(--success); --btn-fg: #fff; --btn-hover-bg: #0B5638; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-hover-bg: #8F1C12; }
.btn-warning { --btn-bg: var(--warning); --btn-fg: var(--ink); --btn-hover-bg: #E09E0B; }
.btn-info { --btn-bg: var(--info); --btn-fg: #fff; --btn-hover-bg: #174A73; }
.btn-light { --btn-bg: var(--paper-raise); --btn-fg: var(--ink); --btn-border: var(--line); --btn-hover-bg: #E3E4DE; --btn-shadow: var(--shadow-raised-sm); }
.btn-dark { --btn-bg: var(--ink-2); --btn-fg: #fff; --btn-hover-bg: var(--ink); }

/* An outline button fills with its colour on hover. */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-danger,
.btn-outline-success {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    --btn-border: var(--field-line);
    --btn-hover-bg: var(--ink);
    --btn-hover-fg: var(--paper);
    --btn-sheen: none;
    --btn-shadow: none;
}
.btn-outline-secondary { --btn-border: var(--line-strong); --btn-hover-bg: var(--ink-2); --btn-hover-fg: #fff; }
.btn-outline-dark { --btn-border: var(--ink-2); --btn-fg: var(--ink-2); --btn-hover-bg: var(--ink-2); --btn-hover-fg: #fff; }
.btn-outline-danger { --btn-border: var(--danger); --btn-fg: var(--danger); --btn-hover-bg: var(--danger); --btn-hover-fg: #fff; }
.btn-outline-success { --btn-border: var(--success); --btn-fg: var(--success); --btn-hover-bg: var(--success); --btn-hover-fg: #fff; }

/* A link that sits next to a button, for example "Cancel" */
.btn-link {
    padding: .65rem .5rem;
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.btn.btn-link { --btn-bg: transparent; --btn-fg: var(--ink); --btn-border: transparent; --btn-hover-bg: var(--paper-raise); --btn-sheen: none; --btn-shadow: none; }
.btn-block,
.btn.d-block { display: flex; width: 100%; }

.btn-close {
    position: absolute;
    top: 50%;
    right: .75rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.btn-close::before {
    content: '\f00d'; /* Font Awesome "xmark" */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: .9em;
}
.btn-close:hover { background: rgba(19, 22, 19, .1); }
.btn-close:focus-visible { box-shadow: var(--ring); }

/* ---------------------------------------------------------------- Alerts */

/* A variant class sets the three custom properties. */
.alert {
    --alert-bg: var(--info-tint);
    --alert-border: var(--info);
    --alert-fg: var(--info-ink);
    position: relative;
    margin-bottom: var(--space-3);
    padding: .8rem 1.1rem;
    border: 1px solid color-mix(in srgb, var(--alert-border) 50%, transparent);
    border-radius: var(--radius-card);
    background: var(--alert-bg);
    box-shadow: 0 1px 2px rgba(19, 22, 19, .05);
    color: var(--alert-fg);
}
.alert-dismissible { padding-right: 3.25rem; }
.alert-primary { --alert-bg: var(--white); --alert-border: var(--ink); --alert-fg: var(--ink); }
.alert-secondary { --alert-bg: var(--paper-raise); --alert-border: var(--line-strong); --alert-fg: var(--ink-2); }
.alert-success { --alert-bg: var(--success-tint); --alert-border: var(--success); --alert-fg: var(--success-ink); }
.alert-danger { --alert-bg: var(--danger-tint); --alert-border: var(--danger); --alert-fg: var(--danger-ink); }
.alert-warning { --alert-bg: var(--warning-tint); --alert-border: var(--warning); --alert-fg: var(--warning-ink); }
.alert-info { --alert-bg: var(--info-tint); --alert-border: var(--info); --alert-fg: var(--info-ink); }
.alert-light { --alert-bg: var(--white); --alert-border: var(--line); --alert-fg: var(--ink-2); }
.alert-dark { --alert-bg: var(--ink); --alert-border: var(--ink); --alert-fg: var(--paper); }
.alert-dark .btn-close:hover { background: rgba(245, 245, 242, .2); }

/* ---------------------------------------------------------------- Forms */

/* One field is a wrapper (.mb-3 or .form-field), a label, a control, an optional help
   text and an optional error message. The markup is the Bootstrap 5 form markup. */
.form-label,
.col-form-label {
    display: block;
    margin-bottom: var(--space-1);
    font-weight: 600;
}
legend.col-form-label { padding: 0; float: none; width: 100%; }
fieldset { margin: 0 0 var(--space-3); padding: 0; border: 0; min-width: 0; }
/* The label of a required field gets a mark. The text of the label names the rule too. */
label.required::after,
legend.required::after { content: ' *'; color: var(--danger); }
/* A group of choices marks its legend. The options inside the group carry no mark. */
fieldset .form-check-label.required::after { content: none; }

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid var(--field-line);
    border-radius: var(--radius-field);
    background-color: var(--white);
    background-image: var(--surface-inset);
    box-shadow: var(--shadow-inset);
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-control::placeholder { color: var(--ink-3); opacity: 1; }
.form-control:hover,
.form-select:hover { border-color: var(--ink); }
.form-control:focus,
.form-select:focus {
    border-color: var(--ink);
    outline: 2px solid var(--ink);
    outline-offset: 0;
    box-shadow: var(--shadow-inset), var(--ring);
}
.form-control:disabled,
.form-select:disabled {
    border-color: var(--line-strong);
    background-color: var(--paper-raise);
    background-image: none;
    box-shadow: none;
    color: var(--ink-3);
    cursor: not-allowed;
}
.form-control[readonly] { background-color: var(--paper-raise); background-image: none; }
textarea.form-control { min-height: 7rem; resize: vertical; }
.form-control-sm { padding: .3rem .6rem; font-size: .875rem; }
.form-control-lg { padding: .85rem 1.1rem; font-size: 1.15rem; }
.form-select-sm { padding-top: .3rem; padding-bottom: .3rem; font-size: .875rem; }
.form-select-lg { padding-top: .85rem; padding-bottom: .85rem; font-size: 1.15rem; }

/* A select draws its own arrow, so the arrow follows the ink colour. */
.form-select {
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23131613' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    padding-right: 2.5rem;
    appearance: none;
    background-image: var(--select-arrow), var(--surface-inset);
    background-repeat: no-repeat;
    background-position: right .85rem center, 0 0;
    background-size: 1rem, 100% 100%;
}
.form-select:disabled { background-image: var(--select-arrow); background-size: 1rem; }
.form-select[multiple],
.form-select[size]:not([size='1']) { padding-right: .85rem; background-image: var(--surface-inset); background-size: 100% 100%; }

.form-control[type='file'] { padding: .4rem .6rem; }
.form-control[type='file']::file-selector-button {
    margin: 0 .75rem 0 0;
    padding: .3rem .9rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.form-control[type='file']::file-selector-button:hover { background: var(--paper-raise); border-color: var(--ink); }
.form-control[type='color'] { width: 3.5rem; height: 2.6rem; padding: .25rem; }
.form-range { width: 100%; accent-color: var(--ink); }

/* Help text sits under the control. */
.form-text { margin-top: var(--space-1); color: var(--ink-3); font-size: .875rem; }

/* Validation: the border and the message use the danger colour. The message is text,
   so a field never shows its state by colour alone. */
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--danger); border-width: 2px; padding: calc(.6rem - 1px) calc(.85rem - 1px); }
.form-control.is-invalid:focus,
.form-select.is-invalid:focus { outline-color: var(--danger); box-shadow: var(--shadow-inset), 0 0 0 4px rgba(180, 35, 24, .25); }
.form-control.is-valid,
.form-select.is-valid { border-color: var(--success); border-width: 2px; padding: calc(.6rem - 1px) calc(.85rem - 1px); }
.invalid-feedback,
.valid-feedback { display: none; margin-top: var(--space-1); font-size: .875rem; font-weight: 500; }
.invalid-feedback { color: var(--danger); }
.valid-feedback { color: var(--success); }
.invalid-feedback.d-block,
.is-invalid ~ .invalid-feedback,
.is-valid ~ .valid-feedback { display: block; }
/* Symfony prints the error as a small "Error" badge followed by the message. */
.form-error-icon { margin-right: .4rem; }
.form-error-message { color: inherit; }

/* Check boxes, radio buttons and switches */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    min-height: 1.5rem;
    margin-bottom: var(--space-2);
}
.form-check-inline { display: inline-flex; margin-right: var(--space-4); }
.form-check-input {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin: .125rem 0 0;
    border: 1px solid var(--field-line);
    background-color: var(--white);
    background-image: var(--surface-inset);
    box-shadow: var(--shadow-inset);
    appearance: none;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
}
.form-check-input[type='checkbox'] { border-radius: 4px; }
.form-check-input[type='radio'] { border-radius: 50%; }
.form-check-input:hover { border-color: var(--ink); }
.form-check-input:checked,
.form-check-input:indeterminate { border-color: var(--ink); background-color: var(--ink); background-image: none; box-shadow: var(--shadow-raised-sm); }
.form-check-input[type='checkbox']:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2336E0A0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E");
    background-size: 100%;
}
.form-check-input[type='radio']:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2' fill='%2336E0A0'/%3E%3C/svg%3E");
    background-size: 100%;
}
.form-check-input:focus-visible { box-shadow: var(--shadow-inset), var(--ring); }
.form-check-input:disabled { border-color: var(--line-strong); background-color: var(--paper-raise); background-image: none; box-shadow: none; cursor: not-allowed; }
.form-check-input:disabled:checked { background-color: var(--ink-3); border-color: var(--ink-3); box-shadow: none; }
.form-check-input:disabled ~ .form-check-label { color: var(--ink-3); cursor: not-allowed; }
.form-check-input.is-invalid { border-color: var(--danger); border-width: 2px; }
.form-check-label { cursor: pointer; font-weight: 400; }

.form-switch .form-check-input {
    --knob-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -5 10 10'%3E%3Cdefs%3E%3Cfilter id='b' x='-50%25' y='-50%25' width='200%25' height='200%25'%3E%3CfeGaussianBlur stdDeviation='.5'/%3E%3C/filter%3E%3C/defs%3E%3Ccircle cy='.8' r='3.3' fill='%23131613' fill-opacity='.4' filter='url(%23b)'/%3E%3Ccircle r='3.3' fill='%23fff'/%3E%3C/svg%3E");
    --knob-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -5 10 10'%3E%3Ccircle r='3.3' fill='%2336E0A0'/%3E%3C/svg%3E");
    width: 2.6rem;
    height: 1.5rem;
    border-radius: var(--radius-pill);
    background-image: var(--knob-off), var(--surface-inset);
    background-repeat: no-repeat;
    background-position: left .12rem center, 0 0;
    background-size: 1.25rem, 100% 100%;
    transition: background-position .12s ease, background-color .12s ease;
}
.form-switch .form-check-input:checked {
    background-image: var(--knob-on);
    background-position: right .12rem center;
    background-size: 1.1rem;
    box-shadow: var(--shadow-inset);
}

/* Prefix and suffix next to a control */
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-control,
.input-group > .form-select { flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group-text {
    display: flex;
    align-items: center;
    padding: .6rem .85rem;
    border: 1px solid var(--field-line);
    background: var(--paper-raise);
    box-shadow: var(--shadow-inset);
    color: var(--ink-2);
    white-space: nowrap;
}
.input-group > :first-child { border-top-left-radius: var(--radius-field); border-bottom-left-radius: var(--radius-field); }
.input-group > :last-child { border-top-right-radius: var(--radius-field); border-bottom-right-radius: var(--radius-field); }
.input-group > :not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .form-control:focus { position: relative; z-index: 1; }
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn { padding-top: .3rem; padding-bottom: .3rem; font-size: .875rem; }

/* The row of buttons under a form */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.form-actions:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- Cards */

/* The card is a raised surface: a faint gradient, a hairline and a soft layered shadow.
   The accent card adds a mint line and a mint glow. A card with a cover link lifts on hover. */
.card {
    position: relative;
    margin-bottom: var(--space-4);
    background-color: var(--white);
    background-image: var(--surface-raised);
    border: 1px solid rgba(19, 22, 19, .07);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: box-shadow .15s ease, transform .15s ease;
}
.card:has(.card-link-cover):hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-accent { border-color: var(--mint); box-shadow: var(--shadow-card-mint); }
.card-header,
.card-body,
.card-footer { padding: var(--space-3) 1.25rem; }
.card-header { border-bottom: 1px solid var(--line); font-weight: 600; }
.card-footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: .875rem; }
.card-title { margin-bottom: var(--space-2); }
/* A heading inside a card is a section title, not a page title: no display font, no capitals. */
.card h2 { font-family: var(--font-text); font-size: 1.2rem; font-weight: 600; letter-spacing: -.005em; text-transform: none; }
.card-link-cover::after { content: ''; position: absolute; inset: 0; }

/* ---------------------------------------------------------------- Badges */

.badge {
    display: inline-block;
    padding: .2rem .8rem;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    background: var(--mint);
    color: var(--ink);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    line-height: 1.4;
    text-transform: uppercase;
}
.badge-quiet { border: 1px solid var(--line); background: var(--paper-raise); }
.badge.bg-danger { background: var(--danger); color: #fff; }
.badge.bg-success { background: var(--success); color: #fff; }
.badge.bg-warning { background: var(--warning); color: var(--ink); }
.badge.bg-info { background: var(--info); color: #fff; }
.text-bg-dark { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- Tables */

.table { width: 100%; border-collapse: collapse; background: var(--white); }
.table th {
    padding: .5rem .7rem;
    border-bottom: 3px solid var(--mint);
    background: var(--paper-raise);
    color: var(--ink);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-align: left;
    text-transform: uppercase;
}
/* A row header names the row. It is not a column head, so it takes no head style. */
.table th[scope='row'] { border-bottom: 1px solid var(--line); background: transparent; font-size: inherit; letter-spacing: 0; text-transform: none; }
.table td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-striped tbody tr:nth-child(even) td { background: var(--paper); }
.table-responsive { overflow-x: auto; }

/* ---------------------------------------------------------------- List groups */

.list-group { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius-field); }
.list-group-item { display: block; padding: var(--space-2) var(--space-3); color: inherit; text-decoration: none; }
.list-group-item + .list-group-item { border-top: 1px solid var(--line); }
/* The first and the last item follow the round corners, so a hover background stays inside the border. */
.list-group-item:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.list-group-item:last-child { border-bottom-right-radius: inherit; border-bottom-left-radius: inherit; }
.list-group-item-action { cursor: pointer; }
.list-group-item-action:hover,
.list-group-item-action:focus-visible { background: var(--paper-raise); }
.list-group-flush { border: 0; border-radius: 0; }
.list-group-flush > .list-group-item { padding-right: 0; padding-left: 0; }

/* ---------------------------------------------------------------- Tabs */

/* The script of the product (or the tab script of Bootstrap) sets .active on the link and
   on the pane, and .show on a pane with .fade. Without .active a pane is hidden. */
.nav { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav-item { display: block; }
.nav-link { display: block; padding: var(--space-2) var(--space-3); border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.nav-link:hover { color: var(--ink); }
/* The outline of base.css stays: it gives the ring its contrast of 3:1. */
.nav-link:focus-visible { border-radius: var(--radius-field); box-shadow: var(--ring); }
.nav-tabs { gap: var(--space-1); border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { margin-bottom: -1px; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { border-bottom-color: var(--ink); color: var(--ink); }
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }
.fade { transition: opacity .15s linear; }
.fade:not(.show) { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .fade { transition: none; } }

/* ---------------------------------------------------------------- Modal */

/* A modal is a native <dialog>. The browser draws it in the top layer, traps the focus
   and closes it on Escape. A script of the product opens and closes it from data attributes. */
.modal {
    width: min(32rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(19, 22, 19, .07);
    border-radius: var(--radius-card);
    background-color: var(--white);
    background-image: var(--surface-raised);
    color: var(--ink);
    box-shadow: 0 2px 6px rgba(19, 22, 19, .08), 0 28px 64px -16px rgba(19, 22, 19, .4);
}
.modal-sm { width: min(24rem, calc(100vw - 2rem)); }
.modal-lg { width: min(48rem, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(19, 22, 19, .55); }
.modal-header {
    position: relative;
    padding: var(--space-3) 3.5rem var(--space-3) 1.25rem;
    border-bottom: 1px solid var(--line);
}
.modal-title { margin: 0; font-size: 1.2rem; }
.modal-header .btn-close { right: .75rem; }
.modal-body { padding: var(--space-3) 1.25rem; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) 1.25rem;
    border-top: 1px solid var(--line);
}
