/* ==========================================================================
   Espresso Mio shared controls (recolor P0)

   Every class here starts with em-. Colours come only from em-tokens.css
   (loaded first). No raw colour values live in this file: check with
     grep -nE "#[0-9a-fA-F]{3,8}\b|rgba?\(" public/css/em-components.css
   which must print nothing.

   Reference with HTML snippets: recolor-design/components.md
   Live page: /style-guide (admin).

   Sections
     1. Base
     2. Page header and breadcrumb
     3. Buttons
     4. Fields
     5. Cards
     6. Tables
     7. Badges
     8. Filter bubbles
     9. Tabs (underline, segmented)
    10. Slide-out panel
    11. Switch
    12. Messages, empty and loading
    13. KPI strip, summary rail
    14. Theme toggle, avatar, helpers
    15. Phone width (44px controls)
    16. Third-party skins: Bootstrap 5, Select2, jQuery UI, DataTables,
        toastr, SweetAlert2
    17. Top-bar layouts: customer account, vendor portal, sign-in pages
    18. Consolidation additions: large and block buttons, card tabs,
        purple and tier badges, selectable row, destructive SweetAlert   ========================================================================== */


/* 1. Base ================================================================= */

.em-scope,
.em-scope * { box-sizing: border-box; }

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

/* Bootstrap 5.0.2 colours every link #0d6efd (a) and #0a58ca (a:hover). Put
   plain links back on the palette at the same specificity, after Bootstrap.
   Any class colour still wins over `a`. */
a { color: var(--em-text-2); }
a:hover { color: var(--em-text); }

/* The native file picker's button is light grey in every theme: put it on the palette. */
:where(input[type="file"])::file-selector-button {
    margin-right: 10px;
    padding: 0 12px;
    min-height: 30px;
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-pill);
    background: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
    font-weight: 600;
    cursor: pointer;
}
:where(input[type="file"])::file-selector-button:hover { background: var(--em-hover); }
/* Bootstrap's .form-control file button keeps its own shape; only its colours change. */
.form-control::file-selector-button { background-color: var(--em-head); color: var(--em-text); border-color: var(--em-line-strong); }
.form-control:hover:not(:disabled):not([readonly])::file-selector-button { background-color: var(--em-hover); }

/* Customer names linked from a legacy table (dashboard New Orders). */
.default_table a.sr-customer-link { color: var(--em-link); font-weight: 600; }
.default_table a.sr-customer-link:hover { color: var(--em-link-hover); text-decoration: underline; text-underline-offset: 3px; }

.em-link,
a.em-link {
    color: var(--em-link);
    text-decoration: none;
    font-weight: 600;
}
.em-link:hover { color: var(--em-link-hover); text-decoration: underline; text-underline-offset: 3px; }

.em-text-2 { color: var(--em-text-2); }
.em-text-3 { color: var(--em-text-3); }
.em-num { text-align: right; font-variant-numeric: tabular-nums; }

.em-stack { display: flex; flex-direction: column; gap: 16px; }
.em-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.em-spacer { flex-grow: 1; }

/* Dark mode: unstyled native controls would otherwise get the browser's grey
   dark-scheme look. Zero specificity, so any class rule still wins. */
:where(html[data-theme="dark"]) :where(button, input[type="button"], input[type="submit"], input[type="reset"]) {
    background-color: var(--em-surface);
    color: var(--em-text);
}
:where(html[data-theme="dark"]) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
    background-color: var(--em-surface);
    color: var(--em-text);
}

:where(.em-btn, .em-input, .em-select, .em-textarea, .em-tab, .em-seg__btn, .em-bubble, .em-switch, .em-link):focus-visible {
    outline: 2px solid var(--em-focus);
    outline-offset: 2px;
}


/* 2. Page header and breadcrumb ========================================== */

.em-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.em-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    padding: 0;
    list-style: none;
    font-family: var(--em-font);
    font-size: 12px;
    font-weight: 500;
    color: var(--em-text-3);
}
.em-crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.em-crumbs li + li::before { content: "/"; color: var(--em-text-3); }
.em-crumbs a { color: var(--em-text-2); text-decoration: underline; text-underline-offset: 3px; }
.em-crumbs a:hover { color: var(--em-link-hover); }
.em-page-title {
    margin: 0;
    font-family: var(--em-font);
    font-size: 22px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--em-text);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.em-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }


/* 3. Buttons ============================================================== */
/* .em-btn alone is the secondary (white pill). Add --main for the one green
   action on a screen, --destructive for red text. */

.em-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: var(--em-control);
    padding: 0 14px;
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-pill);
    background: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, filter .12s ease;
}
.em-btn:hover { background: var(--em-hover); color: var(--em-text); text-decoration: none; }
.em-btn svg { flex: none; }

.em-btn--main {
    padding: 0 16px;
    border-color: var(--em-action);
    background: var(--em-action);
    color: var(--em-action-text);
    font-weight: 600;
}
.em-btn--main:hover { background: var(--em-action-hover); border-color: var(--em-action-hover); color: var(--em-action-text); }

.em-btn--destructive { color: var(--em-danger); font-weight: 600; }
.em-btn--destructive:hover { color: var(--em-danger); background: var(--em-danger-tint); }

.em-btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.em-btn--icon { width: var(--em-control); padding: 0; }
.em-btn--sm.em-btn--icon { width: 32px; }
.em-btn--bare { border-color: transparent; background: transparent; color: var(--em-text-2); }
.em-btn--bare:hover { background: var(--em-hover); }

.em-btn:disabled,
.em-btn[aria-disabled="true"],
.em-btn.is-disabled {
    border-color: var(--em-line-strong);
    background: var(--em-page);
    color: var(--em-text-3);
    cursor: not-allowed;
    filter: none;
}
/* Saving: keep the button's own colour, dim it, show a spinner. */
.em-btn.is-saving,
.em-btn--main.is-saving:disabled {
    border-color: var(--em-action);
    background: var(--em-action);
    color: var(--em-action-text);
    opacity: .75;
    cursor: progress;
}
.em-btn.is-saving::before {
    content: "";
    width: 12px; height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: em-spin .7s linear infinite;
}
@keyframes em-spin { to { transform: rotate(360deg); } }


/* 4. Fields =============================================================== */

.em-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 16px;
}
.em-form-grid > .em-field--wide { grid-column: 1 / -1; }

.em-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.em-label {
    font-family: var(--em-font);
    font-size: 12px;
    font-weight: 600;
    color: var(--em-text-2);
}
/* The required mark is red wherever it sits (.em-label, .form-label, page labels). */
.em-req { color: var(--em-danger); }

.em-input,
.em-select,
.em-textarea {
    width: 100%;
    height: var(--em-control);
    padding: 0 10px;
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
    font-size: 13.5px;
    box-shadow: none;
}
.em-select { padding: 0 8px; }
.em-textarea { height: auto; min-height: 72px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.em-input::placeholder,
.em-textarea::placeholder { color: var(--em-text-3); }
.em-input:focus,
.em-select:focus,
.em-textarea:focus {
    outline: none;
    border-color: var(--em-focus);
    box-shadow: var(--em-focus-ring);
}
.em-input[aria-invalid="true"], .em-input.is-invalid,
.em-select[aria-invalid="true"], .em-select.is-invalid,
.em-textarea[aria-invalid="true"], .em-textarea.is-invalid { border-color: var(--em-danger); }
.em-input:disabled, .em-select:disabled, .em-textarea:disabled,
.em-input[readonly].is-locked {
    background: var(--em-page);
    color: var(--em-text-3);
    cursor: not-allowed;
}
/* .is-focus shows the focus look without focus (style guide previews). */
.em-input.is-focus, .em-select.is-focus, .em-textarea.is-focus { border-color: var(--em-focus); box-shadow: var(--em-focus-ring); }
.em-field-error { font-size: 12px; font-weight: 500; color: var(--em-danger); }
.em-field-hint { font-size: 12px; color: var(--em-text-3); }

.em-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--em-control);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--em-text);
    cursor: pointer;
}
.em-check input[type="checkbox"],
.em-check input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--em-accent-line); }


/* 5. Cards ================================================================ */

.em-card {
    border: 1px solid var(--em-line);
    border-radius: var(--em-radius-card);
    background: var(--em-surface);
    color: var(--em-text);
    overflow: hidden;
}
.em-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--em-line);
}
.em-card__title { margin: 0; font-family: var(--em-font); font-size: 14px; font-weight: 600; color: var(--em-text); }
.em-card__meta { font-size: 12.5px; color: var(--em-text-3); }
.em-card__body { padding: 16px; }
.em-card__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
.em-card__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--em-line);
    background: var(--em-subtle);
}
.em-card__foot--split { justify-content: space-between; }
.em-card__note {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-top: 1px solid var(--em-line);
    background: var(--em-subtle);
    font-size: 12.5px;
    color: var(--em-text-2);
}


/* 6. Tables =============================================================== */
/* Wrap wide tables in .em-table-wrap so they scroll inside their own box. */

/* position: relative keeps absolutely placed bits (the screen-reader "Actions" label) inside the scroll box, so they cannot widen the page. */
.em-table-wrap { position: relative; width: 100%; max-width: 100%; overflow-x: auto; }
/* .em-table-freeze: the head row stays in view while the rows scroll, like a
   frozen row in a spreadsheet. The box scrolls inside itself both ways, at most
   a screen tall less --em-freeze-gap (what the page keeps in view around it,
   such as a sticky pager), so a wide table on a phone scrolls sideways with its
   head row. Works on any table: .default_table, .em-table and the rest. */
.em-table-freeze {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    max-height: calc(100vh - var(--em-freeze-gap, 120px));
    max-height: calc(100dvh - var(--em-freeze-gap, 120px));
    -webkit-overflow-scrolling: touch;
}
.em-table-freeze > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    /* Collapsed borders stay behind when a cell sticks; draw the lines on the cell. */
    box-shadow: inset 0 1px 0 var(--em-line), inset 0 -1px 0 var(--em-line);
}
.em-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--em-font);
    font-size: 13.5px;
    color: var(--em-text);
    background: var(--em-surface);
}
.em-table thead th {
    height: 34px;
    padding: 0 12px;
    background: var(--em-head);
    border-top: 1px solid var(--em-line);
    border-bottom: 1px solid var(--em-line);
    color: var(--em-text-2);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.em-table--flush thead th { border-top: 0; }
.em-table td {
    height: var(--em-row);
    padding: 0 12px;
    background: var(--em-surface);
    vertical-align: middle;
}
.em-table th:first-child,
.em-table td:first-child { padding-left: 16px; }
.em-table th:last-child,
.em-table td:last-child { padding-right: 16px; }
.em-table tbody tr:nth-child(even) td { background: var(--em-stripe); }
.em-table tbody tr:hover td,
.em-table tbody tr.is-hover td { background: var(--em-accent-tint); }
.em-table tbody tr.is-attention td,
.em-table tbody tr.is-attention:hover td {
    background: var(--em-amber-bg);
    color: var(--em-amber-ink);
    font-weight: 600;
}
.em-table tfoot td,
.em-table tr.em-total td {
    height: 42px;
    background: var(--em-head);
    border-top: 1px solid var(--em-line-strong);
    font-weight: 700;
}
/* Many lists still mark money columns with the older .num class (tests read it); it means the same. */
.em-table th.em-num,
.em-table td.em-num,
.em-table th.num,
.em-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.em-table td.em-strong { font-weight: 600; }
.em-table .em-name { font-weight: 600; color: var(--em-name); text-decoration: none; }
.em-table .em-name:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--em-name); }
.em-table-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px 8px 16px;
    border-top: 1px solid var(--em-line);
    font-size: 12.5px;
    color: var(--em-text-2);
}
.em-table-foot strong { color: var(--em-text); font-variant-numeric: tabular-nums; }
.em-pager { display: flex; gap: 6px; }


/* 7. Badges =============================================================== */
/* .em-badge + one kind. The dot is drawn for you. */

.em-badge {
    --em-b-bg: var(--em-neutral-tint);
    --em-b-fg: var(--em-text-2);
    --em-b-dot: currentColor;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--em-radius-pill);
    background: var(--em-b-bg);
    color: var(--em-b-fg);
    font-family: var(--em-font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}
.em-badge::before {
    content: "";
    width: 6px; height: 6px;
    flex: none;
    border-radius: 50%;
    background: var(--em-b-dot);
}
.em-badge--nodot::before { display: none; }
.em-badge--lg { height: 24px; padding: 0 10px; }

.em-badge--ok        { --em-b-bg: var(--em-green-tint);   --em-b-fg: var(--em-green-text); }
.em-badge--attention { --em-b-bg: var(--em-amber-bg);     --em-b-fg: var(--em-amber-ink); --em-b-dot: var(--em-attn-dot); }
.em-badge--bad       { --em-b-bg: var(--em-danger-tint);  --em-b-fg: var(--em-danger); }
.em-badge--info      { --em-b-bg: var(--em-info-bg);      --em-b-fg: var(--em-info-fg); }
.em-badge--neutral   { --em-b-bg: var(--em-neutral-tint); --em-b-fg: var(--em-text-2); }
.em-badge--brand     { --em-b-bg: var(--em-accent-tint);  --em-b-fg: var(--em-accent-text); }

/* The eight lead statuses. Also used by .em-bubble. */
.em-st--lead           { --em-b-bg: var(--em-st-lead-bg);           --em-b-fg: var(--em-st-lead-fg);           --em-b-dot: var(--em-st-lead-dot); }
.em-st--qualified      { --em-b-bg: var(--em-st-qualified-bg);      --em-b-fg: var(--em-st-qualified-fg);      --em-b-dot: var(--em-st-qualified-dot); }
.em-st--proposal       { --em-b-bg: var(--em-st-proposal-bg);       --em-b-fg: var(--em-st-proposal-fg);       --em-b-dot: var(--em-st-proposal-dot); }
.em-st--negotiation    { --em-b-bg: var(--em-st-negotiation-bg);    --em-b-fg: var(--em-st-negotiation-fg);    --em-b-dot: var(--em-st-negotiation-dot); }
.em-st--won            { --em-b-bg: var(--em-st-won-bg);            --em-b-fg: var(--em-st-won-fg);            --em-b-dot: var(--em-st-won-dot); }
.em-st--disqualified   { --em-b-bg: var(--em-st-disqualified-bg);   --em-b-fg: var(--em-st-disqualified-fg);   --em-b-dot: var(--em-st-disqualified-dot); }
.em-st--lost-requested { --em-b-bg: var(--em-st-lost-requested-bg); --em-b-fg: var(--em-st-lost-requested-fg); --em-b-dot: var(--em-st-lost-requested-dot); }
.em-st--lost           { --em-b-bg: var(--em-st-lost-bg);           --em-b-fg: var(--em-st-lost-fg);           --em-b-dot: var(--em-st-lost-dot); }

/* An inline notice pill, such as "Auto-sending is off". */
.em-note-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: var(--em-radius-pill);
    background: var(--em-amber-bg);
    color: var(--em-amber-ink);
    font-size: 12.5px;
}
.em-note-pill::before,
.em-dot {
    content: "";
    display: inline-block;
    width: 7px; height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--em-attn-dot);
}
.em-dot--ok { background: var(--em-green-text); }
.em-dot--bad { background: var(--em-danger); }
.em-dot--off { background: var(--em-line-strong); }


/* 8. Filter bubbles ====================================================== */
/* A row of pill buttons. The picked one (aria-pressed="true" or .is-on)
   fills with its status colour. Without a status class it fills bronze. */

.em-bubbles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Default fill is bronze; the status classes (.em-st--*) override it. */
:where(.em-bubble) {
    --em-b-fg: var(--em-accent-text);
    --em-b-dot: var(--em-accent-text);
}
.em-bubble {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-pill);
    background: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.em-bubble::before {
    content: "";
    width: 8px; height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--em-b-dot);
}
.em-bubble--nodot::before { display: none; }
.em-bubble:hover { background: var(--em-hover); color: var(--em-text); text-decoration: none; }
.em-bubble__count { font-size: 12px; font-weight: 500; color: var(--em-text-3); font-variant-numeric: tabular-nums; }
.em-bubble[aria-pressed="true"],
.em-bubble.is-on,
.em-bubble[aria-current="page"] {
    border-color: var(--em-b-fg);
    background: var(--em-b-fg);
    color: var(--em-on-solid);
    font-weight: 600;
}
.em-bubble[aria-pressed="true"]::before,
.em-bubble.is-on::before,
.em-bubble[aria-current="page"]::before { background: var(--em-on-solid); }
.em-bubble[aria-pressed="true"] .em-bubble__count,
.em-bubble.is-on .em-bubble__count,
.em-bubble[aria-current="page"] .em-bubble__count { color: var(--em-on-solid); }


/* 9. Tabs ================================================================= */

/* Underline tabs: the row of section tabs at the top of a card or page. */
.em-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0 6px;
    list-style: none;
    border-bottom: 1px solid var(--em-line);
}
.em-tabs--flush { border-bottom: 0; }
.em-tabs > li { display: flex; }
.em-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: var(--em-text-2);
    font-family: var(--em-font);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.em-tab:hover { color: var(--em-text); text-decoration: none; }
.em-tab[aria-selected="true"],
.em-tab[aria-current="page"],
.em-tab.is-active {
    color: var(--em-text);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--em-accent-line);
}
.em-tab__count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--em-radius-pill);
    background: var(--em-neutral-tint);
    color: var(--em-text-2);
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.em-tab[aria-selected="true"] .em-tab__count,
.em-tab[aria-current="page"] .em-tab__count,
.em-tab.is-active .em-tab__count { background: var(--em-accent-tint); color: var(--em-accent-text); }

/* Segmented control: two or three views of one list (Active / Archived). */
.em-seg {
    display: inline-flex;
    padding: 2px;
    border-radius: var(--em-radius-pill);
    background: var(--em-head);
}
.em-seg__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--em-radius-pill);
    background: transparent;
    color: var(--em-text-2);
    font-family: var(--em-font);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.em-seg__btn:hover { color: var(--em-text); text-decoration: none; }
.em-seg__btn[aria-selected="true"],
.em-seg__btn[aria-pressed="true"],
.em-seg__btn[aria-current="page"],
.em-seg__btn.is-active {
    background: var(--em-raised);
    color: var(--em-text);
    font-weight: 600;
    box-shadow: var(--em-shadow-sm);
}


/* 10. Slide-out panel ===================================================== */
/* Scrim + panel from the right, max 420px (--wide: 600px). Show and hide
   both by toggling the hidden attribute. */

.em-scrim {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: var(--em-scrim);
}
.em-slideout {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 1045;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    background: var(--em-surface);
    border-left: 1px solid var(--em-line);
    box-shadow: var(--em-shadow-panel);
    color: var(--em-text);
    font-family: var(--em-font);
    font-size: 13.5px;
}
.em-slideout--wide { max-width: 600px; }
.em-scrim[hidden],
.em-slideout[hidden] { display: none; }
.em-slideout__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--em-line);
}
.em-slideout__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--em-text); }
.em-slideout__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
}
.em-slideout__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--em-line);
    background: var(--em-subtle);
}
.em-slideout__foot-end { display: flex; gap: 8px; margin-left: auto; }
/* The style guide shows the panel inside a frame instead of over the page. */
.em-static.em-scrim,
.em-static.em-slideout { position: absolute; }


/* 11. Switch ============================================================== */
/* <button type="button" class="em-switch" role="switch" aria-checked="true">
   or <input type="checkbox" class="em-switch">. */

.em-switch {
    position: relative;
    display: inline-flex;
    flex: none;
    width: 44px;
    height: 26px;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: var(--em-radius-pill);
    background: var(--em-line-strong);
    cursor: pointer;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .15s ease;
}
.em-switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--em-knob);
    box-shadow: var(--em-shadow-knob);
    transition: transform .15s ease;
}
.em-switch[aria-checked="true"],
.em-switch:checked { background: var(--em-accent-line); }
.em-switch[aria-checked="true"]::before,
.em-switch:checked::before { transform: translateX(18px); }
.em-switch:disabled,
.em-switch[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.em-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 10px 16px;
    border-top: 1px solid var(--em-line);
}
.em-setting:first-child { border-top: 0; }
.em-setting__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.em-setting__name { font-weight: 600; color: var(--em-text); }
.em-setting__hint { font-size: 12.5px; color: var(--em-text-3); }


/* 12. Messages, empty and loading ========================================= */

.em-msg {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--em-radius-msg);
    font-family: var(--em-font);
    font-size: 13.5px;
    font-weight: 600;
}
.em-msg svg { flex: none; }
.em-msg--saved { background: var(--em-green-tint); color: var(--em-green-text); }
.em-msg--attention { background: var(--em-amber-bg); color: var(--em-amber-ink); }
.em-msg--attention::before {
    content: "";
    width: 8px; height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--em-attn-dot);
}
.em-msg--failed {
    justify-content: space-between;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--em-danger);
    background: var(--em-surface);
    color: var(--em-danger);
}
.em-msg--info { background: var(--em-info-bg); color: var(--em-info-fg); }
.em-msg__text { flex: 1 1 200px; }
/* Stacked messages (or a message above content) get a gap below. Inside the
   flex helpers that already space their children, the gap is theirs. */
.em-msg:not(:last-child) { margin-bottom: 12px; }
:where(.em-stack, .em-row, .em-layout-rail__main, .em-layout-rail__side, .em-card__foot, .em-slideout__body) > .em-msg { margin-bottom: 0; }
/* Regular weight: the whole message (--regular), or a body line under a bold lead-in (__body). */
.em-msg--regular { font-weight: 400; }
.em-msg__body { flex-basis: 100%; font-weight: 400; }

.em-empty {
    padding: 22px 16px;
    border: 1px dashed var(--em-line-strong);
    border-radius: var(--em-radius-msg);
    text-align: center;
    font-family: var(--em-font);
}
.em-empty--plain { border: 0; border-top: 1px solid var(--em-line); border-radius: 0; padding: 48px 24px; }
.em-empty__title { font-size: 14px; font-weight: 600; color: var(--em-text); }
.em-empty__text { margin-top: 4px; font-size: 13px; color: var(--em-text-3); }

.em-loading {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--em-line);
    border-radius: var(--em-radius-msg);
    font-family: var(--em-font);
}
.em-skel {
    display: block;
    height: 12px;
    border-radius: var(--em-radius-pill);
    background: var(--em-head);
    animation: em-pulse 1.4s ease-in-out infinite;
}
.em-loading__text { font-size: 12.5px; color: var(--em-text-3); }
@keyframes em-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
    .em-skel, .em-btn.is-saving::before { animation: none; }
}


/* 13. KPI strip, summary rail ============================================= */

/* Hairlines are drawn by each tile (right and bottom), and the outer edge is
   clipped, so a row that is not full leaves a plain surface cell rather than a
   line-coloured block (odd tile counts in two columns on phones). */
.em-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
    border: 1px solid var(--em-line);
    border-radius: var(--em-radius-card);
    background: var(--em-surface);
    overflow: hidden;
    font-family: var(--em-font);
}
.em-kpi { padding: 14px 18px; background: var(--em-surface); color: var(--em-text); box-shadow: 1px 0 0 var(--em-line), 0 1px 0 var(--em-line); }
/* A KPI tile that is a link: lifts under the pointer, keeps its own text colour. */
a.em-kpi { display: block; color: var(--em-text); text-decoration: none; transition: background-color .12s ease; }
a.em-kpi:hover { background: var(--em-hover); color: var(--em-text); text-decoration: none; }
a.em-kpi:hover .em-kpi__label { color: var(--em-text-2); }
a.em-kpi.em-kpi--attention:hover,
a.em-kpi.em-kpi--attention:hover .em-kpi__label,
a.em-kpi.em-kpi--attention:hover .em-kpi__sub { background: var(--em-amber-bg); color: var(--em-amber-ink); }
a.em-kpi.em-kpi--attention:hover .em-kpi__value { text-decoration: underline; text-underline-offset: 3px; }
a.em-kpi:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--em-focus); }
.em-kpi__label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--em-text-3); }
.em-kpi__value { margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.em-kpi__sub { margin-top: 2px; font-size: 12px; color: var(--em-text-3); }
.em-kpi__sub a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.em-kpi--attention,
.em-kpi--attention .em-kpi__label,
.em-kpi--attention .em-kpi__sub { background: var(--em-amber-bg); color: var(--em-amber-ink); }
.em-kpi--attention .em-kpi__label::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--em-attn-dot);
}
.em-kpi .em-good { color: var(--em-green-text); }
.em-kpi .em-bad { color: var(--em-danger); }

.em-layout-rail { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.em-layout-rail__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.em-layout-rail__side { flex: 1 1 280px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.em-summary__label { font-size: 12px; font-weight: 500; color: var(--em-text-3); }
.em-summary__value { margin-top: 2px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--em-text); }
.em-summary__sub { margin-top: 2px; font-size: 12.5px; color: var(--em-text-3); }
.em-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 9px 16px;
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--em-line);
    font-family: var(--em-font);
    font-size: 13.5px;
}
.em-kv--top { margin-top: 0; padding-top: 0; border-top: 0; }
.em-kv dt { font-weight: 400; color: var(--em-text-3); }
.em-kv dd { margin: 0; text-align: right; font-weight: 500; color: var(--em-text); font-variant-numeric: tabular-nums; }


/* 14. Theme toggle, avatar, helpers ======================================= */

.em-theme-toggle {
    display: inline-flex;
    flex: none;
    padding: 2px;
    border-radius: var(--em-radius-pill);
    background: var(--em-head);
}
.em-theme-toggle__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--em-radius-pill);
    background: transparent;
    color: var(--em-text-2);
    cursor: pointer;
}
.em-theme-toggle__btn[aria-pressed="true"] {
    background: var(--em-raised);
    color: var(--em-text);
    box-shadow: var(--em-shadow-sm);
}
.em-theme-toggle__btn:focus-visible { outline: 2px solid var(--em-focus); outline-offset: 2px; }

.em-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--em-avatar-bg);
    color: var(--em-avatar-fg);
    font-family: var(--em-font);
    font-size: 11.5px;
    font-weight: 600;
}

.em-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.em-swatch { border: 1px solid var(--em-line); border-radius: var(--em-radius-msg); overflow: hidden; }
.em-swatch__chip { height: 44px; border-bottom: 1px solid var(--em-line); }
.em-swatch__text { padding: 8px 10px; font-size: 12px; color: var(--em-text-3); }
.em-swatch__name { font-size: 13.5px; font-weight: 600; color: var(--em-text); }
.em-swatch__var { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--em-text-2); }


/* 15. Phone width ========================================================= */
/* Under 760px every control is at least 44px high, and pages get a 16px gutter. */

@media (max-width: 760px) {
    .em-btn,
    .em-input,
    .em-select,
    .em-bubble,
    .em-tab,
    .em-seg__btn,
    .em-theme-toggle__btn { min-height: var(--em-control-touch); }
    .em-btn--icon,
    .em-theme-toggle__btn { min-width: var(--em-control-touch); }
    .em-switch { margin: 9px 0; }
    .em-check { min-height: var(--em-control-touch); }
    .em-slideout { max-width: 100%; }
    .em-layout-rail__side { max-width: none; }
}


/* 16. Third-party skins =================================================== */
/* Pages that still use Bootstrap or a plugin pick up the palette here, so
   they need no per-page colour work. */

/* ---- Bootstrap 5.0 ---- */
body { --bs-body-color: var(--em-text); --bs-body-bg: var(--em-page); }

.text-muted { color: var(--em-text-3) !important; }
.text-secondary { color: var(--em-text-2) !important; }
.text-danger { color: var(--em-danger) !important; }
.text-success { color: var(--em-green-text) !important; }
.text-warning { color: var(--em-warn) !important; }
.text-info, .text-primary { color: var(--em-link) !important; }
.text-dark, .text-body { color: var(--em-text) !important; }
.bg-white, .bg-light { background-color: var(--em-surface) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--em-line) !important; }
a.link-primary, .link-primary { color: var(--em-link) !important; }

.btn {
    border-radius: var(--em-radius-pill);
    font-family: var(--em-font);
    font-weight: 500;
}
.btn:focus, .btn:focus-visible { box-shadow: var(--em-focus-ring); }
.btn-group > .btn, .input-group > .btn { border-radius: var(--em-radius-field); }
.btn-primary, .btn-success {
    border-color: var(--em-action);
    background-color: var(--em-action);
    color: var(--em-action-text);
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active,
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active {
    border-color: var(--em-action-hover);
    background-color: var(--em-action-hover);
    color: var(--em-action-text);
}
.btn-secondary, .btn-light, .btn-outline-secondary, .btn-outline-primary,
.btn-outline-success, .btn-outline-dark, .btn-outline-light, .btn-default, .btn-dark {
    border: 1px solid var(--em-line-strong);
    background-color: var(--em-surface);
    color: var(--em-text);
}
.btn-secondary:hover, .btn-light:hover, .btn-outline-secondary:hover, .btn-outline-primary:hover,
.btn-outline-success:hover, .btn-outline-dark:hover, .btn-outline-light:hover, .btn-default:hover, .btn-dark:hover,
.btn-secondary:focus, .btn-light:focus, .btn-outline-secondary:focus, .btn-outline-primary:focus,
.btn-secondary:active, .btn-light:active, .btn-outline-secondary:active, .btn-outline-primary:active {
    border-color: var(--em-line-strong);
    background-color: var(--em-hover);
    color: var(--em-text);
}
.btn-danger, .btn-outline-danger {
    border: 1px solid var(--em-line-strong);
    background-color: var(--em-surface);
    color: var(--em-danger);
    font-weight: 600;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active,
.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active {
    border-color: var(--em-danger);
    background-color: var(--em-danger-tint);
    color: var(--em-danger);
}
.btn-warning, .btn-outline-warning { border-color: var(--em-attn-dot); background-color: var(--em-amber-bg); color: var(--em-amber-ink); }
.btn-info, .btn-outline-info { border-color: var(--em-line-strong); background-color: var(--em-info-bg); color: var(--em-info-fg); }
.btn-link { color: var(--em-link); }
.btn-link:hover { color: var(--em-link-hover); }
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
    border-color: var(--em-line-strong);
    background-color: var(--em-page);
    color: var(--em-text-3);
    opacity: 1;
}
.btn-close { filter: none; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

.form-control, .form-select {
    border-color: var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background-color: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
}
.form-control::placeholder { color: var(--em-text-3); }
.form-control:focus, .form-select:focus {
    border-color: var(--em-focus);
    background-color: var(--em-surface);
    color: var(--em-text);
    box-shadow: var(--em-focus-ring);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled {
    background-color: var(--em-page);
    color: var(--em-text-3);
}
.form-control.is-invalid, .was-validated .form-control:invalid,
.form-select.is-invalid { border-color: var(--em-danger); }
.invalid-feedback { color: var(--em-danger); }
.valid-feedback { color: var(--em-green-text); }
.form-label, .col-form-label { color: var(--em-text-2); font-weight: 600; }
.form-text { color: var(--em-text-3); }
.form-check-input { border-color: var(--em-line-strong); background-color: var(--em-surface); }
.form-check-input:checked { border-color: var(--em-accent-line); background-color: var(--em-accent-line); }
.form-check-input:focus { border-color: var(--em-focus); box-shadow: var(--em-focus-ring); }
.form-switch .form-check-input:checked { background-color: var(--em-accent-line); }
.input-group-text { border-color: var(--em-line-strong); background-color: var(--em-head); color: var(--em-text-2); }

.table {
    --bs-table-bg: var(--em-surface);
    --bs-table-striped-bg: var(--em-stripe);
    --bs-table-striped-color: var(--em-text);
    --bs-table-hover-bg: var(--em-accent-tint);
    --bs-table-hover-color: var(--em-text);
    --bs-table-active-bg: var(--em-accent-tint);
    --bs-table-accent-bg: transparent;
    color: var(--em-text);
    border-color: var(--em-line);
}
.table > :not(caption) > * > * { border-bottom-color: var(--em-line); }
.table > thead > tr > th,
.table thead.table-light th,
.table .table-light th {
    background-color: var(--em-head);
    color: var(--em-text-2);
    border-color: var(--em-line);
}
.table > :not(:first-child) { border-top-color: var(--em-line); }
/* Bootstrap 5.1 draws the head row's bottom line in currentColor (a dark rule); same specificity, loaded later. */
.table > :not(:last-child) > :last-child > * { border-bottom-color: var(--em-line); }

.nav-tabs { border-bottom-color: var(--em-line); }
.nav-tabs .nav-link {
    border: 0;
    border-radius: 0;
    color: var(--em-text-2);
    font-weight: 500;
}
.nav-tabs .nav-link:hover { color: var(--em-text); border: 0; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
    border: 0;
    background: transparent;
    color: var(--em-text);
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--em-accent-line);
}
.nav-pills .nav-link { border-radius: var(--em-radius-pill); color: var(--em-text-2); }
.nav-pills .nav-link.active { background-color: var(--em-accent-line); color: var(--em-on-accent); }
.nav-link { color: var(--em-link); }
.nav-link:hover, .nav-link:focus { color: var(--em-link-hover); }

.modal-content {
    border: 1px solid var(--em-line);
    border-radius: var(--em-radius-card);
    background-color: var(--em-surface);
    color: var(--em-text);
}
.modal-header, .modal-footer { border-color: var(--em-line); }
.modal-footer { background-color: var(--em-subtle); border-radius: 0 0 var(--em-radius-card) var(--em-radius-card); }
.modal-title { font-weight: 700; color: var(--em-text); }
.modal-backdrop { background-color: var(--em-scrim); }
.modal-backdrop.show { opacity: 1; }

.dropdown-menu {
    border: 1px solid var(--em-line);
    border-radius: var(--em-radius-field);
    background-color: var(--em-surface);
    color: var(--em-text);
    box-shadow: var(--em-shadow-pop);
}
.dropdown-item { color: var(--em-text); }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--em-hover); color: var(--em-text); }
.dropdown-item.active, .dropdown-item:active { background-color: var(--em-accent-tint); color: var(--em-accent-text); }
.dropdown-divider { border-color: var(--em-line); }

.alert { border-radius: var(--em-radius-msg); border: 0; font-weight: 500; }
.alert-success { background-color: var(--em-green-tint); color: var(--em-green-text); }
.alert-danger { background-color: var(--em-surface); color: var(--em-danger); border: 1px solid var(--em-danger); }
.alert-warning { background-color: var(--em-amber-bg); color: var(--em-amber-ink); }
.alert-info, .alert-primary { background-color: var(--em-info-bg); color: var(--em-info-fg); }
.alert-secondary, .alert-light, .alert-dark { background-color: var(--em-neutral-tint); color: var(--em-text-2); }
.alert .alert-link { color: inherit; }

.badge { border-radius: var(--em-radius-pill); font-weight: 600; }
.badge.bg-success { background-color: var(--em-green-tint) !important; color: var(--em-green-text); }
.badge.bg-danger { background-color: var(--em-danger-tint) !important; color: var(--em-danger); }
.badge.bg-warning { background-color: var(--em-amber-bg) !important; color: var(--em-amber-ink) !important; }
.badge.bg-info, .badge.bg-primary { background-color: var(--em-info-bg) !important; color: var(--em-info-fg); }
.badge.bg-secondary, .badge.bg-light, .badge.bg-dark { background-color: var(--em-neutral-tint) !important; color: var(--em-text-2) !important; }

.card { border-color: var(--em-line); border-radius: var(--em-radius-card); background-color: var(--em-surface); color: var(--em-text); }
.card-header, .card-footer { border-color: var(--em-line); background-color: var(--em-subtle); }

.page-link { border-color: var(--em-line); background-color: var(--em-surface); color: var(--em-text); }
.page-link:hover, .page-link:focus { border-color: var(--em-line-strong); background-color: var(--em-hover); color: var(--em-text); box-shadow: none; }
.page-item.active .page-link { border-color: var(--em-accent-line); background-color: var(--em-accent-line); color: var(--em-on-accent); }
.page-item.disabled .page-link { border-color: var(--em-line); background-color: var(--em-page); color: var(--em-text-3); }

.list-group-item { border-color: var(--em-line); background-color: var(--em-surface); color: var(--em-text); }
.list-group-item.active { border-color: var(--em-accent-line); background-color: var(--em-accent-tint); color: var(--em-accent-text); }
.progress { background-color: var(--em-head); }
.progress-bar { background-color: var(--em-accent-line); }
.spinner-border { color: var(--em-accent-line); }
.tooltip-inner { background-color: var(--em-nav-bg); color: var(--em-nav-text-strong); }
.popover { border-color: var(--em-line); background-color: var(--em-surface); }
.popover-body { color: var(--em-text); }

/* ---- Select2 ---- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: var(--em-control);
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background-color: var(--em-surface);
}
.select2-container--default .select2-selection--single { height: var(--em-control); }
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 10px;
    line-height: 34px;
    color: var(--em-text);
    font-family: var(--em-font);
    font-size: 13.5px;
}
/* Phones: 44px like every other field. */
@media (max-width: 759.98px) {
    .select2-container--default .select2-selection--single { height: var(--em-control-touch); }
    .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; }
    .select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
}
/* Same text size as the native fields beside them. */
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-search--inline .select2-search__field,
.select2-results__option { font-family: var(--em-font); font-size: 13.5px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--em-text-3); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-top-color: var(--em-text-2); }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-bottom-color: var(--em-text-2); }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--em-focus);
    box-shadow: var(--em-focus-ring);
}
.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple { background-color: var(--em-page); }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 0;
    border-radius: var(--em-radius-pill);
    background-color: var(--em-accent-tint);
    color: var(--em-accent-text);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { border-color: transparent; color: var(--em-accent-text); }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { background-color: var(--em-hover); color: var(--em-danger); }
.select2-dropdown {
    border-color: var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background-color: var(--em-surface);
    color: var(--em-text);
    box-shadow: var(--em-shadow-pop);
}
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--inline .select2-search__field {
    border-color: var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background-color: var(--em-surface);
    color: var(--em-text);
}
.select2-container--default .select2-results__option { color: var(--em-text); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--em-accent-tint); color: var(--em-text); }
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected=true] { background-color: var(--em-head); color: var(--em-text); }
.select2-container--default .select2-results__option--disabled { color: var(--em-text-3); }
.select2-container--default .select2-results__group { color: var(--em-text-2); }

/* ---- jQuery UI (date picker, autocomplete, dialog) ---- */
.ui-widget,
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: var(--em-font); }
.ui-widget.ui-widget-content,
.ui-widget-content {
    border: 1px solid var(--em-line);
    background: var(--em-surface);
    color: var(--em-text);
}
.ui-widget-content a { color: var(--em-link); }
.ui-widget-header {
    border: 0;
    background: var(--em-head);
    color: var(--em-text);
    font-weight: 600;
}
.ui-datepicker { padding: 6px; border-radius: var(--em-radius-card); box-shadow: var(--em-shadow-pop); }
.ui-datepicker .ui-datepicker-header { border-radius: var(--em-radius-field); }
.ui-datepicker th { color: var(--em-text-3); font-weight: 600; }
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default,
.ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active {
    border: 1px solid transparent;
    border-radius: var(--em-radius-field);
    background: transparent;
    color: var(--em-text);
    font-weight: 500;
    text-align: center;
}
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover,
.ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus,
.ui-button:hover, .ui-button:focus {
    border: 1px solid var(--em-line-strong);
    background: var(--em-hover);
    color: var(--em-text);
}
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active,
a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
    border: 1px solid var(--em-accent-line);
    background: var(--em-accent-line);
    color: var(--em-on-accent);
    font-weight: 600;
}
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
    border: 1px solid var(--em-accent-line);
    background: var(--em-accent-tint);
    color: var(--em-accent-text);
}
.ui-state-error, .ui-widget-content .ui-state-error { border: 1px solid var(--em-danger); background: var(--em-danger-tint); color: var(--em-danger); }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { cursor: pointer; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 2px; border: 1px solid var(--em-line-strong); background: var(--em-hover); }
html[data-theme="dark"] .ui-icon,
html[data-theme="dark"] .ui-widget-header .ui-icon { filter: invert(1); }
.ui-menu .ui-menu-item-wrapper.ui-state-active { border-radius: 0; }
.ui-widget-overlay { background: var(--em-scrim); opacity: 1; }

/* ---- DataTables ---- */
table.dataTable { color: var(--em-text); border-collapse: collapse; }
table.dataTable thead th,
table.dataTable thead td {
    border-bottom: 1px solid var(--em-line);
    background-color: var(--em-head);
    color: var(--em-text-2);
}
table.dataTable tbody tr { background-color: var(--em-surface); }
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd { background-color: var(--em-surface); }
table.dataTable.stripe tbody tr.even,
table.dataTable.display tbody tr.even { background-color: var(--em-stripe); }
table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover { background-color: var(--em-accent-tint); }
table.dataTable.no-footer { border-bottom-color: var(--em-line); }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate { color: var(--em-text-2); }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background-color: var(--em-surface);
    color: var(--em-text);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--em-line) !important;
    border-radius: var(--em-radius-pill) !important;
    background: var(--em-surface) !important;
    color: var(--em-text) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--em-hover) !important; color: var(--em-text) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border-color: var(--em-accent-line) !important;
    background: var(--em-accent-line) !important;
    color: var(--em-on-accent) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover { background: var(--em-page) !important; color: var(--em-text-3) !important; }

/* ---- toastr (loaded at the end of <body>, so these selectors are longer) ---- */
html body #toast-container > div {
    padding: 12px 14px 12px 16px;
    border: 1px solid var(--em-line);
    border-left: 4px solid var(--em-b-fg, var(--em-accent-line));
    border-radius: var(--em-radius-msg);
    background-color: var(--em-raised);
    background-image: none;
    color: var(--em-text);
    box-shadow: var(--em-shadow-pop);
    opacity: 1;
    font-family: var(--em-font);
}
html body #toast-container > div:hover { box-shadow: var(--em-shadow-pop); }
html body #toast-container > .toast-success { --em-b-fg: var(--em-action); }
html body #toast-container > .toast-error { --em-b-fg: var(--em-danger); }
html body #toast-container > .toast-warning { --em-b-fg: var(--em-attn-dot); }
html body #toast-container > .toast-info { --em-b-fg: var(--em-info-fg); }
html body #toast-container .toast-title { font-weight: 700; color: var(--em-text); }
html body #toast-container > .toast-success .toast-title { color: var(--em-green-text); }
html body #toast-container > .toast-error .toast-title { color: var(--em-danger); }
html body #toast-container > .toast-warning .toast-title { color: var(--em-warn); }
html body #toast-container > .toast-info .toast-title { color: var(--em-info-fg); }
html body #toast-container .toast-message { color: var(--em-text); }
html body #toast-container .toast-close-button { color: var(--em-text-2); text-shadow: none; opacity: .8; }
html body #toast-container .toast-progress { background-color: var(--em-b-fg, var(--em-accent-line)); opacity: .5; }

/* ---- SweetAlert2 ---- */
html body .swal2-popup {
    border-radius: var(--em-radius-card);
    background: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
}
html body .swal2-title { color: var(--em-text); font-size: 20px; }
html body .swal2-html-container { color: var(--em-text-2); }
html body .swal2-styled { border-radius: var(--em-radius-pill); font-weight: 600; box-shadow: none; }
html body .swal2-styled.swal2-confirm { background-color: var(--em-action); color: var(--em-action-text); }
html body .swal2-styled.swal2-cancel,
html body .swal2-styled.swal2-deny { border: 1px solid var(--em-line-strong); background-color: var(--em-surface); color: var(--em-text); }
html body .swal2-styled:focus { box-shadow: var(--em-focus-ring); }
html body .swal2-container.swal2-backdrop-show { background: var(--em-scrim); }
html body .swal2-input, html body .swal2-textarea, html body .swal2-select {
    border-color: var(--em-line-strong);
    background: var(--em-surface);
    color: var(--em-text);
}


/* 17. Top-bar layouts ===================================================== */
/* Shell only: customer account (layouts/app), vendor portal and the
   sign-in pages that use auth/espresso-auth. Light only: these audiences
   are designed light (build spec, "Decisions still open"). */

/* ---- Customer account: the sidebar becomes a black bar across the top ---- */
.em-shell-account { background: var(--em-page); color: var(--em-text); font-family: var(--em-font); }
.em-shell-account::before,
.em-shell-account::after { display: none; }
.em-shell-account .sidebar_logo img { width: 86px; }
.em-shell-account .app_sidebar { background: var(--em-nav-bg); box-shadow: none; }
.em-shell-account .sidebar_nav .nav_item {
    min-height: var(--em-control);
    padding: 0 12px;
    border: 0;
    border-radius: var(--em-radius-field);
    color: var(--em-nav-text);
    font-size: 13.5px;
    font-weight: 500;
}
.em-shell-account .sidebar_nav .nav_item:hover { background: var(--em-nav-hover); color: var(--em-nav-text-strong); }
.em-shell-account .sidebar_nav .nav_item.is_active {
    background: var(--em-nav-active);
    color: var(--em-nav-text-strong);
    font-weight: 600;
}
.em-shell-account .sidebar_nav .nav_icon { width: 16px; height: 16px; }
.em-shell-account .sidebar_help { background: transparent; box-shadow: none; padding: 0; }
.em-shell-account .sidebar_help .help_head,
.em-shell-account .sidebar_help .help_title { color: var(--em-nav-text-strong); }
.em-shell-account .sidebar_help .help_sub { color: var(--em-nav-text-dim); }
.em-shell-account .sidebar_help .help_button {
    min-height: var(--em-control);
    padding: 0 14px;
    border: 1px solid var(--em-nav-divider);
    color: var(--em-nav-text-strong);
    font-size: 13px;
    font-weight: 600;
}
.em-shell-account .sidebar_help .help_button:hover { background: var(--em-nav-hover); color: var(--em-nav-text-strong); }
.em-shell-account .app_topbar {
    min-height: var(--em-topbar);
    padding: 10px var(--shell-inset);
    margin-bottom: 20px;
    background: var(--em-surface);
    border-bottom: 1px solid var(--em-line);
}
.em-shell-account .topbar_title { font-size: 22px; letter-spacing: -0.02em; color: var(--em-text); }
.em-shell-account .topbar_back,
.em-shell-account .topbar_icon { color: var(--em-text-2); }
.em-shell-account .topbar_cart .cart_count { background: var(--em-accent-line); color: var(--em-on-accent); }
.em-shell-account .user_avatar { width: 32px; height: 32px; flex-basis: 32px; background: var(--em-avatar-bg); color: var(--em-avatar-fg); font-size: 11.5px; font-weight: 600; }
.em-shell-account .user_name { font-size: 13.5px; color: var(--em-text); }
.em-shell-account .user_tier { font-size: 12px; color: var(--em-text-3); }
.em-shell-account .user_menu { border-color: var(--em-line); background: var(--em-surface); box-shadow: var(--em-shadow-pop); }
.em-shell-account .user_menu .user_identity { border-color: var(--em-line); }
.em-shell-account .user_menu .menu_name { color: var(--em-text); }
.em-shell-account .user_menu .menu_email { color: var(--em-text-3); }
.em-shell-account .user_menu a,
.em-shell-account .user_menu button { color: var(--em-text); }
.em-shell-account .user_menu a:hover,
.em-shell-account .user_menu button:hover { background: var(--em-hover); }
.em-shell-account .topbar_burger span { background: var(--em-text); }
.em-shell-account .sidebar_scrim { background: var(--em-scrim); }

@media (min-width: 992px) {
    .em-shell-account .app_shell { flex-direction: column; }
    .em-shell-account .app_sidebar {
        position: sticky;
        top: 0;
        flex: none;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px 20px;
        padding: 10px var(--shell-inset);
    }
    .em-shell-account .sidebar_top { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 20px; width: auto; flex: 1 1 400px; }
    .em-shell-account .sidebar_nav { flex-direction: row; flex-wrap: wrap; gap: 2px; width: auto; padding: 0; }
    .em-shell-account .sidebar_help { width: auto; flex-direction: row; align-items: center; gap: 12px; }
    .em-shell-account .sidebar_help .help_head { display: none; }
}
@media (max-width: 991px) {
    .em-shell-account .app_sidebar { padding: 20px 12px; align-items: stretch; }
    .em-shell-account .sidebar_top { align-items: flex-start; gap: 24px; }
    .em-shell-account .sidebar_logo { padding: 0 12px; }
    .em-shell-account .sidebar_nav { padding: 0; gap: 2px; }
    .em-shell-account .sidebar_nav .nav_item { min-height: var(--em-control-touch); }
    .em-shell-account .sidebar_help { width: 100%; }
    .em-shell-account .sidebar_help .help_button { min-height: var(--em-control-touch); }
    .em-shell-account .topbar_title { font-size: 18px; }
}

/* ---- Vendor portal: the left menu becomes a black bar across the top ---- */
.vp-body.em-shell-vendor { background: var(--em-page); color: var(--em-text); font-family: var(--em-font); }
.em-shell-vendor .vp-shell { flex-direction: column; flex-wrap: nowrap; background: var(--em-page); }
.em-shell-vendor .vp-nav {
    flex: none;
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    padding: 10px 24px;
    border: 0;
    background: var(--em-nav-bg);
    color: var(--em-nav-text);
    box-shadow: none;
}
.em-shell-vendor .vp-brand { flex-direction: row; align-items: center; gap: 12px; padding: 0; }
/* The partial still points at the colour logo: draw it white on the black bar. */
.em-shell-vendor .vp-brand img { width: 86px; filter: brightness(0) invert(1); }
.em-shell-vendor .vp-kicker { color: var(--em-nav-text-dim); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.em-shell-vendor .vp-nav-links { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px; flex: 1 1 400px; padding: 0; }
.em-shell-vendor .vp-nav .vp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--em-control);
    padding: 0 12px;
    border: 0;
    border-radius: var(--em-radius-field);
    background: transparent;
    color: var(--em-nav-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.em-shell-vendor .vp-nav .vp-link:hover { background: var(--em-nav-hover); color: var(--em-nav-text-strong); }
.em-shell-vendor .vp-nav .vp-link.is-active {
    background: var(--em-nav-active);
    color: var(--em-nav-text-strong);
    font-weight: 600;
}
.em-shell-vendor .vp-nav .vp-link svg { width: 16px; height: 16px; }
.em-shell-vendor .vp-help { display: none; }
.em-shell-vendor .vp-signout { margin: 0; padding: 0; border: 0; }
.em-shell-vendor .vp-main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 24px 24px; }
.em-shell-vendor .vp-banner { background: var(--em-amber-bg); color: var(--em-amber-ink); }
@media (max-width: 760px) {
    .em-shell-vendor .vp-nav { position: static; padding: 10px 16px; }
    .em-shell-vendor .vp-nav .vp-link { min-height: var(--em-control-touch); }
    .em-shell-vendor .vp-main { padding: 16px; }
}

/* ---- Sign-in pages (auth/espresso-auth): black page, white logo, white card ---- */
.ea-body.em-shell-auth {
    background: var(--em-nav-bg);
    color: var(--em-text);
    font-family: var(--em-font);
}
.em-shell-auth .ea-header,
.em-shell-auth .ea-main,
.em-shell-auth .ea-card { box-sizing: border-box; }
.em-shell-auth .ea-header {
    height: auto;
    padding: 40px 16px 0;
    background: none;
}
.em-shell-auth .ea-header__logo { width: 190px; max-width: 60%; filter: none; }
.em-shell-auth .ea-main { padding: 28px 16px 48px; }
.em-shell-auth .ea-card {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    border-radius: 14px;
    background: var(--em-surface);
    color: var(--em-text);
    text-align: left;
}
.em-shell-auth .ea-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--em-text); }
.em-shell-auth .ea-subtitle { color: var(--em-text-2); }
.em-shell-auth .ea-field label { font-size: 12px; font-weight: 600; color: var(--em-text-2); }
.em-shell-auth .ea-field input {
    height: var(--em-control-touch);
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-field);
    background: var(--em-surface);
    color: var(--em-text);
}
.em-shell-auth .ea-field input:focus { border-color: var(--em-focus); box-shadow: var(--em-focus-ring); outline: none; }
.em-shell-auth .ea-field .ea-field-error { color: var(--em-danger); }
.em-shell-auth .ea-btn {
    min-height: var(--em-control-touch);
    border: 0;
    border-radius: var(--em-radius-pill);
    background: var(--em-action);
    color: var(--em-action-text);
    font-weight: 600;
}
.em-shell-auth .ea-btn:hover { background: var(--em-action-hover); color: var(--em-action-text); }
.em-shell-auth .ea-link,
.em-shell-auth .ea-card a:not(.ea-btn) { color: var(--em-link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.em-shell-auth .ea-link:hover,
.em-shell-auth .ea-card a:not(.ea-btn):hover { color: var(--em-link-hover); }
.em-shell-auth a.ea-btn { text-decoration: none; }
/* Secondary pill on the sign-in card (Back). */
.em-shell-auth .ea-btn.ea-btn--ghost { border: 1px solid var(--em-line-strong); background: var(--em-surface); color: var(--em-text); }
.em-shell-auth .ea-btn.ea-btn--ghost:hover { background: var(--em-hover); color: var(--em-text); }
/* Error list at the top of a sign-in form. */
.em-shell-auth .ea-errors { margin: 0 0 4px; padding: 0; list-style: none; text-align: left; }
.em-shell-auth .ea-errors li { margin-bottom: 8px; padding: 10px 14px; border: 1px solid var(--em-danger); border-radius: var(--em-radius-msg); background: var(--em-danger-tint); color: var(--em-danger); font-size: 13px; line-height: 1.4; }
.em-shell-auth .ea-status { border: 0; border-radius: var(--em-radius-msg); background: var(--em-green-tint); color: var(--em-green-text); }
.em-shell-auth .ea-success { text-align: center; }

/* Icon images that are a fixed colour in the file.
   .em-icon      a black icon: turns white in dark mode.
   .em-icon-inv  a white icon: turns dark on a light surface. */
html[data-theme="dark"] img.em-icon { filter: invert(1); }
html:not([data-theme="dark"]) img.em-icon-inv { filter: invert(1); }

/* Legacy black icons that sit on page surfaces: sort carets, row menus, filter chips. */
html[data-theme="dark"] .default_table th img,
html[data-theme="dark"] .view_more > img,
html[data-theme="dark"] .view_more > a > img,
html[data-theme="dark"] .remove-filter img { filter: invert(1); }

/* The Download button is a white pill but its arrow file is white. */
html:not([data-theme="dark"]) .download_wrap a.download-btn img { filter: invert(1); }

/* Filter chips whose close link is .remove-filter-chip (customers, machines). */
html[data-theme="dark"] .remove-filter-chip img { filter: invert(1); }

/* Sort carets in .sr-table headers (orders, machines). */
html[data-theme="dark"] .sr-table th img { filter: invert(1); }

/* arrow-back.svg is drawn in bronze, not black: inverting it would turn it blue. */
html[data-theme="dark"] img.em-icon[src*="arrow-back"] { filter: none; }


/* 18. Consolidation additions ============================================ */
/* Shared versions of controls that two or more packages built locally.
   Reference: recolor-design/components-additions.md. */

/* Buttons: 48px (the proposal page's main action) and full width. */
.em-btn--lg { height: 48px; min-height: 48px; padding: 0 28px; font-size: 15px; }
.em-btn--block { display: flex; width: 100%; }

/* Underline tabs on their own surface card; the row scrolls sideways when it
   does not fit (record section rows). */
.em-tabs--card {
    flex-wrap: nowrap;
    overflow-x: auto;
    border: 1px solid var(--em-line);
    border-radius: var(--em-radius-card);
    background: var(--em-surface);
    scrollbar-width: thin;
}
.em-tabs--card .em-tab { flex: none; }

/* Dots: attention said out loud (the bare .em-dot is also attention). */
.em-dot--attention { background: var(--em-attn-dot); }
.em-dot--info { background: var(--em-info-fg); }

/* Badge kinds: purple (Packed and other in-hand states) and loyalty tiers. */
.em-badge--purple         { --em-b-bg: var(--em-purple-bg);        --em-b-fg: var(--em-purple-fg);        --em-b-dot: var(--em-purple-dot); }
.em-badge--tier-platinum  { --em-b-bg: var(--em-tier-platinum-bg); --em-b-fg: var(--em-tier-platinum-fg); --em-b-dot: var(--em-tier-platinum-dot); }
.em-badge--tier-gold      { --em-b-bg: var(--em-tier-gold-bg);     --em-b-fg: var(--em-tier-gold-fg);     --em-b-dot: var(--em-tier-gold-dot); }
.em-badge--tier-silver    { --em-b-bg: var(--em-tier-silver-bg);   --em-b-fg: var(--em-tier-silver-fg);   --em-b-dot: var(--em-tier-silver-dot); }
.em-badge--tier-bronze    { --em-b-bg: var(--em-tier-bronze-bg);   --em-b-fg: var(--em-tier-bronze-fg);   --em-b-dot: var(--em-tier-bronze-dot); }

/* A selectable row (pick one or several items): plain when off, bronze
   outline and tint when chosen. Chosen = .is-selected, aria-checked /
   aria-selected="true", or a checked input inside. */
.em-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--em-line-strong);
    border-radius: var(--em-radius-card);
    background: var(--em-surface);
    color: var(--em-text);
    font-family: var(--em-font);
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
}
.em-choice:hover { border-color: var(--em-accent-line); }
.em-choice.is-selected,
.em-choice[aria-checked="true"],
.em-choice[aria-selected="true"],
.em-choice:has(> input:checked),
.em-choice:has(> * > input:checked) {
    border-color: var(--em-accent-line);
    background: var(--em-accent-tint);
    box-shadow: inset 0 0 0 1px var(--em-accent-line);
}
.em-choice input[type="checkbox"],
.em-choice input[type="radio"] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--em-accent-line); }

/* SweetAlert2 destructive confirm: pass customClass: { confirmButton: 'em-swal-danger' }. */
html body .swal2-styled.swal2-confirm.em-swal-danger { border: 1px solid var(--em-line-strong); background-color: var(--em-surface); background-image: none; color: var(--em-danger); }
html body .swal2-styled.swal2-confirm.em-swal-danger:hover { background-color: var(--em-danger-tint); background-image: none; color: var(--em-danger); }

/* Paragraphs inside cards and slide-outs are body text. The legacy global
   `p { font-size:16px; letter-spacing:.5px }` in styles.css made card copy look
   larger and tracked. Zero added specificity, so any page class still wins. */
:where(.em-card, .em-slideout, .em-kv, .em-page-head, .em-empty) p,
p:where(.em-msg) { font-size: 13.5px; line-height: 1.5; letter-spacing: normal; }

/* An em-table that also carries Bootstrap's .table: drop Bootstrap's 2px
   current-colour line under the head row, its 1rem bottom margin (empty strip
   inside the card) and its bottom-aligned head cells. */
.em-table.table { margin-bottom: 0; }
.em-table.table > :not(:first-child) { border-top: 0; }
.em-table.table > thead > tr > th { vertical-align: middle; }

/* Bootstrap colours <code> a raw pink; inline code reads in its sentence's colour. */
code { color: inherit; }
