/* ==========================================================================
   md-pages.css -- Material 3 look for the shared back-office pieces
   Cards, headings, buttons, fields, tables, windows (ro-modal), summary
   cards, badges and confirm dialogs, for the pages marked <body class="md-ui">.
   Page-specific rules follow in their own sections. Loaded after md-app.css.
   Older stylesheets (theme.css in particular) reach these elements with
   long selectors; the properties that must win are forced.
   Created: 2026-09-20
   ========================================================================== */

/* ---------- Page frame ---------- */
html:has(body.md-ui),
body.md-ui,
body.md-ui .app,
body.md-ui .main {
    background: var(--md-surface) !important;
}
body.md-ui .main .page {
    max-width: none;
    gap: 16px;
    padding: 0 16px 16px 0;
    box-sizing: border-box;
}
body.md-ui .page > .card,
body.md-ui .card {
    background: var(--md-surface-container-low) !important;
    border: 0 !important;
    border-radius: 24px !important;
    box-shadow: none !important;
    color: var(--md-on-surface);
    padding: 24px;
}
body.md-ui .h1,
body.md-ui h1.h1 {
    font-family: var(--md-font-sans);
    font-size: 24px !important;
    line-height: 32px;
    font-weight: 400 !important;
    letter-spacing: 0;
    color: var(--md-on-surface) !important;
}
body.md-ui h2,
body.md-ui h3 {
    font-family: var(--md-font-sans);
    color: var(--md-on-surface);
}
body.md-ui .sub,
body.md-ui .muted {
    color: var(--md-on-surface-variant) !important;
}

/* ---------- Buttons ---------- */
body.md-ui .btn,
body.md-ui .ro-modal-btn,
body.md-ui .btn-sm {
    height: 40px;
    padding: 0 24px;
    border-radius: 20px !important;
    border: 1px solid var(--md-outline) !important;
    background: transparent !important;
    color: var(--md-primary) !important;
    font-family: var(--md-font-sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none !important;
    transform: none !important;
    cursor: pointer;
    white-space: nowrap;
}
body.md-ui .btn-sm {
    height: 32px;
    padding: 0 16px;
    font-size: 13px;
}
body.md-ui .btn:hover:not(:disabled),
body.md-ui .ro-modal-btn:hover:not(:disabled),
body.md-ui .btn-sm:hover:not(:disabled) {
    background: color-mix(in srgb, var(--md-primary) 8%, transparent) !important;
}
body.md-ui .btn.primary,
body.md-ui .ro-modal-btn.primary {
    background: var(--md-primary) !important;
    color: var(--md-on-primary) !important;
    border-color: var(--md-primary) !important;
}
body.md-ui .btn.primary:hover:not(:disabled),
body.md-ui .ro-modal-btn.primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--md-on-primary) 8%, var(--md-primary)) !important;
    box-shadow: var(--md-elevation-1) !important;
}
body.md-ui .btn.danger,
body.md-ui .btnDanger,
body.md-ui .ro-modal-btn.danger,
body.md-ui .btn-sm.danger {
    background: transparent !important;
    color: var(--md-error) !important;
    border-color: var(--md-error) !important;
}
body.md-ui .btn.danger:hover:not(:disabled),
body.md-ui .ro-modal-btn.danger:hover:not(:disabled),
body.md-ui .btn-sm.danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--md-error) 10%, transparent) !important;
}
body.md-ui .ro-modal-btn.warn {
    color: var(--md-primary) !important;
}
body.md-ui .btn:disabled,
body.md-ui .ro-modal-btn:disabled,
body.md-ui .btn-sm:disabled {
    opacity: .38;
    cursor: default;
}
body.md-ui .btn:focus-visible,
body.md-ui .ro-modal-btn:focus-visible {
    outline: 2px solid var(--md-primary);
    outline-offset: 2px;
}

/* ---------- Fields ---------- */
body.md-ui .label,
body.md-ui .field-label,
body.md-ui .ro-modal-label {
    font-family: var(--md-font-sans);
    font-size: 12px !important;
    line-height: 16px;
    font-weight: 500 !important;
    letter-spacing: .04em;
    text-transform: none !important;
    color: var(--md-on-surface-variant) !important;
}
body.md-ui .input,
body.md-ui .ro-modal-input,
body.md-ui select.input,
body.md-ui textarea.input,
body.md-ui .ro-modal select,
body.md-ui .ro-modal textarea,
body.md-ui .ro-modal input[type="text"],
body.md-ui .ro-modal input[type="email"],
body.md-ui .ro-modal input[type="number"],
body.md-ui .ro-modal input[type="date"],
body.md-ui .ro-modal input[type="password"],
body.md-ui .ro-modal input[type="tel"],
body.md-ui .ro-modal input[type="url"] {
    min-height: 48px;
    padding: 0 14px !important;
    border-radius: 4px !important;
    border: 1px solid var(--md-outline) !important;
    background: transparent !important;
    color: var(--md-on-surface) !important;
    font-family: var(--md-font-sans);
    font-size: 15px !important;
    box-sizing: border-box;
}
body.md-ui textarea.input,
body.md-ui .ro-modal textarea {
    padding: 12px 14px !important;
    min-height: 88px;
}
body.md-ui .input:focus,
body.md-ui .ro-modal-input:focus,
body.md-ui .ro-modal select:focus,
body.md-ui .ro-modal textarea:focus,
body.md-ui .ro-modal input:focus {
    outline: none !important;
    border: 2px solid var(--md-primary) !important;
    padding: 0 13px !important;
}
body.md-ui textarea.input:focus,
body.md-ui .ro-modal textarea:focus {
    padding: 11px 13px !important;
}
body.md-ui .input::placeholder,
body.md-ui .ro-modal-input::placeholder {
    color: var(--md-on-surface-variant) !important;
    opacity: .7;
}
body.md-ui select.input option,
body.md-ui .ro-modal select option {
    background: var(--md-surface-container);
    color: var(--md-on-surface);
}
body.md-ui .ro-modal-hint {
    color: var(--md-on-surface-variant) !important;
    font-size: 12px;
}
body.md-ui input[type="checkbox"],
body.md-ui input[type="radio"] {
    accent-color: var(--md-primary);
}

/* ---------- Tables (reservations and history) ---------- */
body.md-ui .res-table {
    border-collapse: collapse;
    width: 100%;
    font-family: var(--md-font-sans);
}
body.md-ui .res-table thead th {
    height: 44px;
    padding: 0 12px !important;
    background: transparent !important;
    border-bottom: 1px solid var(--md-outline-variant) !important;
    color: var(--md-on-surface-variant) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: .03em !important;
    text-transform: none !important;
    text-align: left;
    white-space: nowrap;
}
body.md-ui .res-table tbody td {
    height: 52px;
    padding: 0 12px !important;
    border-bottom: 1px solid var(--md-outline-variant) !important;
    color: var(--md-on-surface);
    font-size: 14px;
    background: transparent;
}
body.md-ui .res-table tbody tr:hover td {
    background: color-mix(in srgb, var(--md-on-surface) 5%, transparent);
}
body.md-ui .res-table tbody tr:hover {
    background: transparent;
}
body.md-ui .res-table tbody tr.row-selected td {
    background: var(--md-secondary-container) !important;
    color: var(--md-on-secondary-container) !important;
}
body.md-ui .res-table tbody td:first-child {
    font-weight: 500;
    color: var(--md-on-surface);
}
body.md-ui .res-table tbody td.seats-short {
    color: var(--md-error) !important;
    font-weight: 500;
}
body.md-ui .res-table tbody tr.row-arrived td:first-child {
    color: var(--md-arrived) !important;
}
body.md-ui .res-comment::before {
    color: var(--md-on-surface-variant);
}

/* ---------- Empty and loading states ---------- */
body.md-ui .res-empty {
    color: var(--md-on-surface-variant);
}

/* ---------- Windows (ro-modal) ---------- */
body.md-ui .ro-modal-overlay {
    background: rgba(0, 0, 0, .45) !important;
    backdrop-filter: none !important;
}
body.md-ui .ro-modal {
    background: var(--md-surface-container-high) !important;
    color: var(--md-on-surface) !important;
    border: 0 !important;
    border-radius: 28px !important;
    box-shadow: var(--md-elevation-3) !important;
}
body.md-ui .ro-modal-head {
    padding: 24px 24px 16px !important;
    border-bottom: 0 !important;
    background: transparent !important;
}
body.md-ui .ro-modal-title {
    font-family: var(--md-font-sans);
    font-size: 24px !important;
    line-height: 32px;
    font-weight: 400 !important;
    color: var(--md-on-surface) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
body.md-ui .ro-modal-title svg {
    color: var(--md-on-secondary-container);
}
body.md-ui .ro-modal-close {
    width: 40px !important;
    height: 40px !important;
    border-radius: 20px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--md-on-surface-variant) !important;
    font-size: 22px !important;
}
body.md-ui .ro-modal-close:hover {
    background: color-mix(in srgb, var(--md-on-surface) 8%, transparent) !important;
}
body.md-ui .ro-modal-body {
    padding: 0 24px 16px !important;
}
body.md-ui .ro-modal-foot {
    padding: 16px 24px 24px !important;
    border-top: 0 !important;
    background: transparent !important;
    gap: 8px;
}
body.md-ui .ro-modal-sep {
    background: var(--md-outline-variant) !important;
    border-color: var(--md-outline-variant) !important;
}
body.md-ui .ro-modal-btn-add {
    height: 32px;
    padding: 0 16px;
    border-radius: 16px !important;
    border: 0 !important;
    background: var(--md-secondary-container) !important;
    color: var(--md-on-secondary-container) !important;
    font-size: 13px;
    font-weight: 500;
}

/* ---------- Confirm dialogs ---------- */
body.md-ui .confirm-dialog {
    background: var(--md-surface-container-high) !important;
    color: var(--md-on-surface) !important;
    border: 0 !important;
    border-radius: 28px !important;
    box-shadow: var(--md-elevation-3) !important;
    padding: 24px !important;
}
body.md-ui .confirm-dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}

/* ---------- Summary cards (restaurant sheet, administration, ...) ---------- */
body.md-ui .cards-grid {
    gap: 16px !important;
}
body.md-ui .summary-card {
    background: var(--md-surface-container-lowest) !important;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    padding: 20px !important;
    transition: box-shadow .15s, background .15s;
}
body.md-ui .summary-card:hover {
    transform: none !important;
    box-shadow: var(--md-elevation-1) !important;
}
body.md-ui .summary-card-title {
    font-family: var(--md-font-sans);
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--md-on-surface) !important;
    text-transform: none !important;
    letter-spacing: .01em !important;
    gap: 12px;
}
body.md-ui .summary-card-title svg {
    width: 40px !important;
    height: 40px !important;
    padding: 9px;
    box-sizing: border-box;
    border-radius: 12px;
    background: var(--md-primary-container);
    color: var(--md-on-primary-container) !important;
    stroke: currentColor;
}
body.md-ui .summary-card-edit {
    opacity: 1 !important;
    color: var(--md-primary) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}
body.md-ui .summary-card-body {
    color: var(--md-on-surface-variant) !important;
    font-size: 14px !important;
}
body.md-ui .summary-row {
    color: var(--md-on-surface);
}
body.md-ui .summary-label {
    color: var(--md-on-surface-variant);
    opacity: 1 !important;
}
body.md-ui .summary-value {
    color: var(--md-on-surface);
    font-weight: 500;
}
body.md-ui .summary-value.is-warn {
    color: var(--md-error) !important;
}

/* ---------- Badges ---------- */
body.md-ui .status-badge,
body.md-ui .sub-badge,
body.md-ui .sc-badge {
    border-radius: 6px !important;
    border: 0 !important;
    padding: 2px 8px !important;
    font-family: var(--md-font-sans);
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: .02em !important;
    text-transform: none !important;
    background: var(--md-surface-container-highest) !important;
    color: var(--md-on-surface-variant) !important;
}
body.md-ui .status-badge.active,
body.md-ui .sub-badge.active {
    background: var(--md-free-container) !important;
    color: var(--md-on-free-container) !important;
}
body.md-ui .status-badge.inactive,
body.md-ui .sub-badge.pastdue,
body.md-ui .sub-badge.suspended {
    background: var(--md-error-container) !important;
    color: var(--md-on-error-container) !important;
}
body.md-ui .sub-badge.trialing,
body.md-ui .status-badge.type-terrace {
    background: var(--md-tertiary-container) !important;
    color: var(--md-on-tertiary-container) !important;
}
body.md-ui .status-badge.type-interior {
    background: var(--md-secondary-container) !important;
    color: var(--md-on-secondary-container) !important;
}

/* ---------- Toasts as snackbars ---------- */
body.md-ui .toast-container .toast,
body.md-ui .toast {
    background: var(--md-inverse-surface) !important;
    color: var(--md-inverse-on-surface) !important;
    border: 0 !important;
    border-radius: 4px !important;
    box-shadow: var(--md-elevation-3) !important;
    font-family: var(--md-font-sans);
}

/* ==========================================================================
   Réservations (lot 3)
   ========================================================================== */
body.md-ui .desk {
    gap: 16px !important;
}
body.md-ui .desk-body {
    background: var(--md-surface-container-low) !important;
    border: 0 !important;
    border-radius: 24px !important;
    padding: 8px 16px 16px !important;
    min-height: calc(100vh - 130px) !important;
    box-shadow: none !important;
}
body.md-ui .desk-body::before {
    opacity: .03 !important;
}
body.md-ui .status-group {
    display: inline-flex !important;
    gap: 0 !important;
}
body.md-ui .status-btn {
    height: 32px !important;
    padding: 0 12px !important;
    margin-left: -1px;
    border: 1px solid var(--md-outline) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--md-on-surface-variant) !important;
    font-family: var(--md-font-sans);
    font-size: 12px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    box-shadow: none !important;
    white-space: nowrap;
}
body.md-ui .status-btn:first-child {
    margin-left: 0;
    border-radius: 16px 0 0 16px !important;
}
body.md-ui .status-btn:last-child {
    border-radius: 0 16px 16px 0 !important;
}
body.md-ui .status-btn:hover {
    background: color-mix(in srgb, var(--md-on-surface) 8%, transparent) !important;
}
body.md-ui .status-btn.active::before {
    content: "check";
    font-family: var(--md-font-icons);
    font-size: 16px;
    line-height: 1;
    margin-right: 4px;
    vertical-align: -3px;
}
body.md-ui .status-btn[data-status="Confirmed"].active {
    background: var(--md-reserved-container) !important;
    color: var(--md-on-reserved-container) !important;
}
body.md-ui .status-btn[data-status="Arrived"].active {
    background: var(--md-arrived-container) !important;
    color: var(--md-on-arrived-container) !important;
}
body.md-ui .status-btn[data-status="NoShow"].active {
    background: var(--md-blocked-container) !important;
    color: var(--md-on-blocked-container) !important;
}
body.md-ui .status-btn[data-status="Cancelled"].active {
    background: var(--md-error-container) !important;
    color: var(--md-on-error-container) !important;
}

/* Terrace banner */
body.md-ui .terrace-banner {
    background: var(--md-arrived-container) !important;
    color: var(--md-on-arrived-container) !important;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    padding: 12px 16px !important;
    font-family: var(--md-font-sans);
}
body.md-ui .terrace-banner.is-active {
    background: var(--md-primary-container) !important;
    color: var(--md-on-primary-container) !important;
}
body.md-ui .terrace-banner .tb-title {
    color: inherit !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}
body.md-ui .terrace-banner .tb-detail,
body.md-ui .terrace-banner .tb-credit {
    color: inherit !important;
    opacity: .9;
}
body.md-ui .terrace-banner .tb-btn {
    height: 40px;
    padding: 0 20px !important;
    border-radius: 20px !important;
    border: 1px solid currentColor !important;
    background: transparent !important;
    color: inherit !important;
    font-family: var(--md-font-sans);
    font-size: 14px !important;
    font-weight: 500 !important;
}
body.md-ui .terrace-banner .tb-btn-strong {
    background: var(--md-primary) !important;
    color: var(--md-on-primary) !important;
    border-color: var(--md-primary) !important;
}

/* ==========================================================================
   The day's table that does not move (3.33, Greg 01.10.2026), every screen
   ==========================================================================
   "Le texte bouge a chaque rafraichissement": in automatic layout the
   columns were computed again from the content at each silent refresh, and
   once more when the guest badges arrived a moment later. Fixed layout, one
   width per column: a refresh, a badge or a longer name moves nothing. The
   status column is as wide as the widest status of the language, measured
   once by js/reservations.js (--res-status-w, --res-pill-w). Name and comment
   share what is left. */
body.md-ui .res-day-table {
    table-layout: fixed;
    min-width: 1450px;
}
body.md-ui .res-day-table th.col-time { width: 72px; }
body.md-ui .res-day-table th.col-room { width: 6%; }
body.md-ui .res-day-table th.col-table { width: 4%; }
body.md-ui .res-day-table th.col-name { width: 18%; }
body.md-ui .res-day-table th.col-guests { width: 64px; }
body.md-ui .res-day-table th.col-seats { width: 72px; }
body.md-ui .res-day-table th.col-baby { width: 104px; }
body.md-ui .res-day-table th.col-phone { width: 8%; }
body.md-ui .res-day-table th.col-email { width: 10%; }
body.md-ui .res-day-table th.col-status { width: calc(var(--res-status-w, 400px) + 24px); }
/* A fixed column cuts what is longer, whole on hover (title). */
body.md-ui .res-day-table tbody td.col-room,
body.md-ui .res-day-table tbody td.col-table,
body.md-ui .res-day-table tbody td.col-phone,
body.md-ui .res-day-table tbody td.col-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The name and its badges on one line, the badges right after the name and
   level with it (Greg, 01.10.2026: the "Note" pill sat under the name, off
   its left edge, and made the row taller). The name gives way first, then
   the note's text; the pills keep their whole shape. */
body.md-ui .res-day-table .res-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
body.md-ui .res-day-table .res-name-text {
    flex: 0 1 auto;
    min-width: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.md-ui .res-day-table .res-name-badges {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
}
body.md-ui .res-day-table .res-name-badges:empty {
    display: none;
}
body.md-ui .res-day-table .res-name-badges > * {
    flex: none;
    margin: 0 !important;
}
/* The groups of small chips give way before the pills that act ("Note"):
   those keep their whole shape. */
body.md-ui .res-day-table .res-name-badges .cu-chips {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}
/* The service note (js/reservations.js, placeBadges): its tags and its text
   in a note line, the Note button at its end; without a note, the Note
   button alone after the badges. One line, never more: the note's text
   gives way first (ellipsis, the whole text in its bubble), the pills keep
   their shape. */
body.md-ui .res-day-table .res-name-line > .svn-edit,
body.md-ui .res-day-table .res-note-line .svn-edit {
    flex: none;
    margin: 0 !important;
}
body.md-ui .res-day-table .res-note-line {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
}
body.md-ui .res-day-table .res-note-line .svn-chips {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    /* As narrow as its tags: the note's text gives way, never a tag. */
    min-width: auto;
    margin: 0 !important;
    overflow: hidden;
}
body.md-ui .res-day-table .res-note-line .svn-chip {
    flex: none;
}
body.md-ui .res-day-table .res-note-line .svn-note {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* What matters first (the net of 01.10.2026: on a desk screen the allergy
   pill of a guest with many badges was cut away): the guest file's pills,
   allergy and VIP at their head, then the no-shows, the deposit, the zone,
   the guest's confirmation, the service note's tags last -- they give way
   first. */
body.md-ui .res-day-table .res-name-badges .cu-chips { order: 1; }
body.md-ui .res-day-table .res-name-badges .ns-chip { order: 2; }
body.md-ui .res-day-table .res-name-badges .dep-chip { order: 3; }
body.md-ui .res-day-table .res-name-badges .zc-chip { order: 4; }
body.md-ui .res-day-table .res-name-badges .res-guest-confirmed { order: 5; }

body.md-ui .res-day-table .res-name-badges .cu-chip--allergy { order: -2; }
body.md-ui .res-day-table .res-name-badges .cu-chip--vip { order: -1; }
/* A desk screen (Greg, 01.10.2026, 23:45, "Note en une ligne"): the name,
   the guest's badges right after it (whole: the name gives way first) and,
   without a note, the Note button, on the first line; the note line, when
   there is one, alone on a second line under the name, the whole width of
   the cell. 52 px without a note, about 70 with one. */
@media (min-width: 1400px) {
    body.md-ui .res-day-table .res-name-line {
        display: grid;
        grid-template-columns: minmax(3em, max-content) max-content max-content minmax(0, 1fr);
        column-gap: 6px;
        row-gap: 2px;
        align-items: center;
    }
    body.md-ui .res-day-table .res-name-text {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }
    body.md-ui .res-day-table .res-name-badges {
        grid-column: 2;
        grid-row: 1;
        overflow: visible;
    }
    body.md-ui .res-day-table .res-name-badges .cu-chips {
        overflow: visible;
    }
    body.md-ui .res-day-table .res-name-line > .svn-edit {
        grid-column: 3;
        grid-row: 1;
    }
    body.md-ui .res-day-table .res-note-line {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow: hidden;
    }
}
/* A tablet: the note line joins the name's line, as before. */
@media (max-width: 1399px) {
    body.md-ui .res-day-table .res-note-line {
        display: contents;
    }
}
body.md-ui .res-day-table tbody td.res-comment {
    max-width: none;
}

/* ==========================================================================
   Réservations on a tablet (3.33, Greg 01.10.2026)
   ==========================================================================
   From his Android tablet held landscape (960 CSS px at DPR 2): eleven
   columns, the phone on three lines, the status as four buttons that ran out
   of the frame, the terrace strip a tall band. Under 1400 px:
   - the phone and the e-mail leave the row: a tap on the row opens the guest
     file, whose phone is a link that calls (js/reservations.js);
   - the columns nobody filled that day hidden (the table's classes,
     res-one-room, res-no-baby, res-no-comment, say which);
   - the status as one pill that opens the four choices in a menu;
   - the terrace strip as one thin line that opens to its detail.
   Nothing scrolls sideways from 960 to 1399 px. A wide screen keeps its
   columns: the pieces below are hidden there. */
body.md-ui .res-table .res-status-pick,
body.md-ui .terrace-banner .tb-toggle {
    display: none;
}

/* The pill (shown on a tablet only; styled here so that its width can be
   measured on any screen). */
body.md-ui .res-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    box-sizing: border-box;
    height: 32px;
    padding: 0 4px 0 12px;
    border: 1px solid var(--md-outline);
    border-radius: 8px;
    background: transparent;
    color: var(--md-on-surface-variant);
    font: 500 13px/1 var(--md-font-sans);
    white-space: nowrap;
    cursor: pointer;
}
body.md-ui .res-status-pill .md-icon {
    font-size: 20px;
}
body.md-ui .res-status-pill:focus-visible {
    outline: 2px solid var(--md-primary);
    outline-offset: 2px;
}
body.md-ui .res-status-pill[aria-expanded="true"] {
    box-shadow: 0 0 0 2px var(--md-primary);
}
body.md-ui .res-status-pill[data-status="Confirmed"] {
    border-color: transparent;
    background: var(--md-reserved-container);
    color: var(--md-on-reserved-container);
}
body.md-ui .res-status-pill[data-status="Arrived"] {
    border-color: transparent;
    background: var(--md-arrived-container);
    color: var(--md-on-arrived-container);
}
body.md-ui .res-status-pill[data-status="NoShow"] {
    border-color: transparent;
    background: var(--md-blocked-container);
    color: var(--md-on-blocked-container);
}
body.md-ui .res-status-pill[data-status="Cancelled"] {
    border-color: transparent;
    background: var(--md-error-container);
    color: var(--md-on-error-container);
}

/* The status menu (js/reservations.js, openStatusMenu): a dot in the colour
   of each status, as on the pill and the plan. */
body.md-ui .res-status-menu .res-status-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--md-outline);
}
body.md-ui .res-status-menu [data-status="Confirmed"] .res-status-dot { background: var(--md-reserved); }
body.md-ui .res-status-menu [data-status="Arrived"] .res-status-dot { background: var(--md-arrived); }
body.md-ui .res-status-menu [data-status="NoShow"] .res-status-dot { background: var(--md-blocked); }
body.md-ui .res-status-menu [data-status="Cancelled"] .res-status-dot { background: var(--md-error); }

/* A guest without a file, tapped on a tablet: how to reach them
   (js/reservations.js, openContact). */
body.md-ui .res-contact-pop {
    position: fixed;
    min-width: 240px;
    padding: 8px 0;
}
body.md-ui .res-contact-pop .res-contact-name {
    padding: 4px 16px 8px;
    font: 500 15px/20px var(--md-font-sans);
    color: var(--md-on-surface);
}
body.md-ui .res-contact-pop a.md-pop-item {
    text-decoration: none;
}
body.md-ui .res-contact-pop .res-contact-none {
    padding: 4px 16px 8px;
    font: 400 13px/18px var(--md-font-sans);
    color: var(--md-on-surface-variant);
}

/* The search on every date (js/reservations.js, showWide): under the search
   field of the top bar, every screen. */
body.md-ui .res-wide {
    position: fixed;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    padding: 4px 0 8px;
    z-index: 470;
}
body.md-ui .res-wide-head,
body.md-ui .res-wide-note {
    padding: 8px 16px 4px;
    font: 500 12px/16px var(--md-font-sans);
    letter-spacing: .04em;
    color: var(--md-on-surface-variant);
}
body.md-ui .res-wide-note {
    font-weight: 400;
    letter-spacing: 0;
}
body.md-ui .res-wide-item {
    min-height: 52px;
    white-space: normal;
}
body.md-ui .res-wide-when {
    flex: none;
    width: 112px;
    display: flex;
    flex-direction: column;
    font: 500 13px/18px var(--md-font-sans);
    color: var(--md-on-surface);
}
body.md-ui .res-wide-when small {
    font-size: 12px;
    font-weight: 400;
    color: var(--md-on-surface-variant);
}
body.md-ui .res-wide-who {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font: 400 14px/20px var(--md-font-sans);
}
body.md-ui .res-wide-who strong {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.md-ui .res-wide-who small {
    font-size: 12px;
    color: var(--md-on-surface-variant);
}
body.md-ui .res-wide-past {
    flex: none;
    padding: 2px 8px;
    border-radius: 6px;
    font: 500 11px/16px var(--md-font-sans);
    background: var(--md-surface-container-highest);
    color: var(--md-on-surface-variant);
}
body.md-ui .res-wide-item.is-past .res-wide-when,
body.md-ui .res-wide-item.is-past .res-wide-who {
    opacity: .7;
}

@media (max-width: 1399px) {
    body.md-ui .res-table .col-phone,
    body.md-ui .res-table .col-email,
    body.md-ui .res-table.res-one-room .col-room,
    body.md-ui .res-table.res-no-baby .col-baby,
    body.md-ui .res-table.res-no-comment .col-comment {
        display: none;
    }
    body.md-ui .res-table thead th {
        padding: 0 8px !important;
    }
    body.md-ui .res-table tbody td {
        height: 56px;
        padding: 6px 8px !important;
    }
    body.md-ui .res-table thead th:first-child,
    body.md-ui .res-table tbody td:first-child {
        padding-left: 12px !important;
    }

    /* The tablet's widths: the name and the comment share the rest. */
    body.md-ui .res-day-table { min-width: 0; }
    body.md-ui .res-day-table th.col-time { width: 64px; }
    body.md-ui .res-day-table th.col-room { width: 100px; }
    body.md-ui .res-day-table th.col-table { width: 64px; }
    body.md-ui .res-day-table th.col-name { width: auto; }
    body.md-ui .res-day-table th.col-guests { width: 60px; }
    body.md-ui .res-day-table th.col-seats { width: 64px; }
    body.md-ui .res-day-table th.col-baby { width: 100px; }
    body.md-ui .res-day-table th.col-status { width: calc(var(--res-pill-w, 132px) + 16px); }

    body.md-ui .res-table tbody td.col-name {
        font-weight: 500;
    }
    /* Beside the name, what cannot wait (VIP, allergy), as on the "Ce soir"
       rows of the plan; the rank of the visit and the rest are in the file,
       a tap away. */
    body.md-ui .res-day-table .cu-chip--visit,
    body.md-ui .res-day-table .cu-chip--new,
    body.md-ui .res-day-table .cu-chip--noshow,
    body.md-ui .res-day-table .cu-chip--note {
        display: none;
    }

    /* The comment on two lines rather than one cut short (an allergy is
       read here), never more: every row keeps the same height. Whole on a
       long press (title). */
    body.md-ui .res-table tbody td.res-comment {
        white-space: normal;
        overflow: hidden;
        font-size: 13px;
        line-height: 18px;
    }
    body.md-ui .res-day-table tbody td.res-comment::before {
        display: none;
    }
    body.md-ui .res-day-table .res-comment-text {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    /* The status: the pill, not the group. */
    body.md-ui .res-table .status-group {
        display: none !important;
    }
    body.md-ui .res-table .res-status-pick {
        display: block;
    }

    /* The terrace strip: one line, the title and the figure that matters;
       a tap opens the detail and its buttons (js/terrace-banner.js). */
    body.md-ui .terrace-banner {
        gap: 8px 12px;
        padding: 0 !important;
        border-radius: 12px !important;
    }
    body.md-ui .terrace-banner .tb-toggle {
        display: flex;
        flex: 1 1 100%;
        align-items: center;
        gap: 8px;
        min-width: 0;
        min-height: 40px;
        padding: 0 8px 0 16px;
        border: 0;
        border-radius: inherit;
        background: transparent;
        color: inherit;
        font: 400 14px/20px var(--md-font-sans);
        text-align: left;
        cursor: pointer;
    }
    body.md-ui .terrace-banner .tb-toggle:focus-visible {
        outline: 2px solid var(--md-primary);
        outline-offset: -2px;
    }
    body.md-ui .terrace-banner .tb-toggle-title {
        flex: none;
        font-weight: 500;
        white-space: nowrap;
    }
    body.md-ui .terrace-banner .tb-toggle-key {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    body.md-ui .terrace-banner .tb-toggle-key::before {
        content: "\00b7";
        margin-right: 8px;
    }
    body.md-ui .terrace-banner .tb-toggle-chevron {
        flex: none;
        font-size: 22px;
        transition: transform .2s;
    }
    body.md-ui .terrace-banner.is-open .tb-toggle-chevron {
        transform: rotate(180deg);
    }
    body.md-ui .terrace-banner:not(.is-open) > :not(.tb-toggle) {
        display: none !important;
    }
    body.md-ui .terrace-banner.is-open {
        padding: 0 0 12px !important;
    }
    body.md-ui .terrace-banner.is-open .tb-text .tb-title {
        display: none;
    }
    body.md-ui .terrace-banner.is-open .tb-text {
        padding-left: 16px;
    }
    body.md-ui .terrace-banner.is-open .tb-actions {
        padding: 0 16px;
    }
    body.md-ui .terrace-banner.is-open .tb-credit {
        padding-right: 16px;
    }
}

/* ==========================================================================
   Historique (lot 3)
   ========================================================================== */
body.md-ui .hist-filters {
    gap: 12px 16px !important;
}
body.md-ui .hist-counters {
    gap: 12px !important;
}
body.md-ui .hist-counter {
    background: var(--md-surface-container-low) !important;
    border: 0 !important;
    border-radius: 16px !important;
    padding: 16px 20px !important;
    box-shadow: none !important;
}
body.md-ui .hist-counter-value {
    font-family: var(--md-font-sans);
    font-size: 28px !important;
    font-weight: 400 !important;
    color: var(--md-on-surface) !important;
}
body.md-ui .hist-counter-label {
    font-size: 12px !important;
    color: var(--md-on-surface-variant) !important;
    text-transform: none !important;
    letter-spacing: .03em !important;
}
body.md-ui .hist-counter.is-quiet {
    opacity: .75;
}
body.md-ui .hist-status {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--md-free-container);
    color: var(--md-on-free-container) !important;
}
body.md-ui .hist-status.st-cancelled {
    background: var(--md-error-container);
    color: var(--md-on-error-container) !important;
}
body.md-ui .hist-status.st-noshow {
    background: var(--md-blocked-container);
    color: var(--md-on-blocked-container) !important;
}
body.md-ui .hist-pager {
    gap: 12px !important;
    padding-top: 12px;
}

/* ==========================================================================
   Mon restaurant (lot 4): header of the sheet
   ========================================================================== */
body.md-ui .rst-header {
    background: var(--md-surface-container-low) !important;
    border: 0 !important;
    border-radius: 24px !important;
    box-shadow: none !important;
    padding: 16px 24px !important;
}
body.md-ui .rst-header-logo {
    border-radius: 16px !important;
    border: 0 !important;
    background: var(--md-surface-container-highest) !important;
    /* The logo whole, not cropped into a square (Greg, 27.09.2026): the box
       follows a wide logo, up to 240 px. */
    width: auto !important;
    min-width: 50px;
    max-width: 240px;
    padding: 0 8px;
    box-sizing: border-box;
}
body.md-ui .rst-header-logo img {
    width: auto !important;
    height: 40px !important;
    max-width: 224px;
    object-fit: contain !important;
}
body.md-ui .rst-header-logo.logo-on-dark { background: #2f2a24 !important; }
/* Readable as it is: no ground, no halo (27.09.2026). */
body.md-ui .rst-header-logo.logo-plain { background: transparent !important; padding: 0 !important; }
body.md-ui .rst-header-logo.logo-on-light { background: #fff !important; }
body.md-ui .rst-header-name {
    font-family: var(--md-font-sans) !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    color: var(--md-on-surface) !important;
}
body.md-ui .rst-header-addr,
body.md-ui .rst-header-created {
    color: var(--md-on-surface-variant) !important;
}
body.md-ui .rst-chip {
    border-radius: 8px !important;
    border: 1px solid var(--md-outline-variant) !important;
    background: transparent !important;
    font-family: var(--md-font-sans);
}
body.md-ui .rst-chip-key {
    color: var(--md-on-surface-variant) !important;
}

/* ---------- Browser autofill ----------
   Same repaint as on the sign-in page: an inset shadow in the colour of the
   surface the field sits on, and a readable text colour. */
body.md-ui .input:-webkit-autofill,
body.md-ui .input:-webkit-autofill:hover,
body.md-ui .input:-webkit-autofill:focus,
body.md-ui .input:-webkit-autofill:active,
body.md-ui input:-webkit-autofill,
body.md-ui input:-webkit-autofill:hover,
body.md-ui input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    -webkit-text-fill-color: var(--md-on-surface) !important;
    caret-color: var(--md-on-surface);
    transition: background-color 99999s ease-out 0s;
}
body.md-ui .ro-modal input:-webkit-autofill,
body.md-ui .ro-modal input:-webkit-autofill:hover,
body.md-ui .ro-modal input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
}

body.md-ui input:autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    -webkit-text-fill-color: var(--md-on-surface) !important;
}
body.md-ui .ro-modal input:autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
}

body.md-ui input:-internal-autofill-selected {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    -webkit-text-fill-color: var(--md-on-surface) !important;
}
body.md-ui .ro-modal input:-internal-autofill-selected {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
}

body.md-ui input:-internal-autofill-previewed {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-low) inset !important;
    -webkit-text-fill-color: var(--md-on-surface) !important;
}
body.md-ui .ro-modal input:-internal-autofill-previewed {
    -webkit-box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
    box-shadow: 0 0 0 1000px var(--md-surface-container-high) inset !important;
}

/* ==========================================================================
   Historique : status and service as filter chips (M3 finishing)
   ========================================================================== */
/* Second line of the filter card: the two chip groups on the left, Reset and
   the exports pushed to the right, as on the mockup. */
body.md-ui .hist-chiprow {
    flex: 1 0 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}
body.md-ui .hist-chipfield {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
body.md-ui .hist-chiplabel {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .5px;
    color: var(--md-on-surface-variant);
    margin-right: 4px;
}
body.md-ui .md-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
body.md-ui .hist-chiprow .hist-actions {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 auto !important;
}
body.md-ui .hist-chiprow #histReset,
body.md-ui .hist-chiprow .hist-exports {
    grid-column: auto;
}
/* Icons of the export buttons drawn by CSS: data-i18n rewrites the button text,
   and would remove an icon placed inside it. */
body.md-ui .hist-export-xlsx::before,
body.md-ui .hist-export-pdf::before {
    font-family: var(--md-font-icons);
    font-size: 18px;
    line-height: 1;
    font-weight: normal;
    margin-right: 8px;
    vertical-align: -4px;
    -webkit-font-feature-settings: "liga";
    font-feature-settings: "liga";
}
body.md-ui .hist-export-xlsx::before { content: "table_view"; }
body.md-ui .hist-export-pdf::before { content: "picture_as_pdf"; }

@media (max-width: 720px) {
    body.md-ui .hist-chiprow .hist-actions {
        margin: 0 !important;
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Utilisateurs (M3 finishing): creation form on the left, list on the right
   ========================================================================== */
body.md-ui .users-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
body.md-ui .users-head .h1 { margin: 0; }
body.md-ui .users-head .sub { margin: 6px 0 0; }
body.md-ui .users-count {
    padding: 4px 12px;
    border-radius: var(--md-shape-sm);
    background: var(--md-surface-container-high);
    color: var(--md-on-surface-variant);
    font: 500 12px/16px var(--md-font-sans);
    white-space: nowrap;
}
body.md-ui .users-count:empty { display: none; }

body.md-ui .users-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
body.md-ui .users-layout > .card { margin: 0; }

/* Creation form, one field per line */
body.md-ui .users-create-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
body.md-ui .users-create-head .card-section-title { margin: 0; font-size: 18px; font-weight: 500; }
body.md-ui .users-create-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--md-shape-md);
    background: var(--md-secondary-container);
    color: var(--md-on-secondary-container);
    flex-shrink: 0;
}
body.md-ui .users-create .create-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 14px;
}
body.md-ui .users-create .create-form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
body.md-ui .users-create .create-form label,
body.md-ui .users-create .field-perms-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--md-on-surface-variant);
}
body.md-ui .users-create .create-form .input { width: 100%; }
body.md-ui .users-create .perms-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0 0;
}
body.md-ui .users-create .perm-check {
    gap: 10px;
    font-size: 14px;
    color: var(--md-on-surface);
}
body.md-ui .users-create .users-create-btn {
    align-self: flex-start;
    width: auto !important;
    padding: 0 24px 0 16px !important;
}
/* Icon drawn by CSS: data-i18n rewrites the button text. */
body.md-ui .users-create-btn::before {
    content: "add";
    font-family: var(--md-font-icons);
    font-size: 18px;
    line-height: 1;
    font-weight: normal;
    margin-right: 8px;
    vertical-align: -4px;
    font-feature-settings: "liga";
}
body.md-ui .users-create-result { margin-top: 14px; font-size: 13px; }
body.md-ui .users-create-result:empty { display: none; }

/* List card: filters on top, then the groups, all in one card */
body.md-ui .users-listcard .filters-bar {
    gap: 12px;
    margin-bottom: 8px;
}
body.md-ui .users-listcard .filters-bar .input { width: auto; }
body.md-ui .users-listcard .filters-bar #filterSearch { flex: 1 1 220px; min-width: 200px; }
/* The groups and the empty state are rendered as cards by users.js; inside
   the list card they become plain sections. */
body.md-ui .users-listcard #usersList .card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.md-ui .users-listcard .users-group-header {
    padding: 16px 0 8px;
    border-bottom: 0;
    color: var(--md-primary);
    font-size: 11px;
    letter-spacing: .8px;
}
body.md-ui .users-listcard .users-group-header svg { display: none; }
body.md-ui .users-listcard .users-group-count { color: var(--md-on-surface-variant); }
body.md-ui .users-listcard .users-restaurant-header {
    padding: 8px 0 4px;
    gap: 4px;
    color: var(--md-on-surface);
    font-size: 14px;
    font-weight: 500;
}
body.md-ui .users-listcard .users-restaurant-header .md-icon {
    font-size: 18px;
    color: var(--md-on-surface-variant);
}
body.md-ui .users-listcard .users-restaurant-empty { padding: 4px 0 8px 24px; }

/* One user per line: avatar, email, badges and date, actions */
body.md-ui .users-listcard .user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px;
    border-bottom: 0;
    border-radius: var(--md-shape-md);
}
body.md-ui .users-listcard .user-row.indented { padding-left: 24px; }
body.md-ui .users-listcard .user-row:hover { background: var(--md-surface-container-high); }
body.md-ui .user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--md-primary-container);
    color: var(--md-on-primary-container);
    font: 500 14px/1 var(--md-font-sans);
    flex-shrink: 0;
}
body.md-ui .users-listcard .user-email {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
}
body.md-ui .user-self {
    color: var(--md-on-surface-variant);
    font-weight: 400;
}
body.md-ui .users-listcard .user-meta {
    flex-wrap: nowrap;
    gap: 8px;
    font-size: 12px;
    color: var(--md-on-surface-variant);
}
body.md-ui .user-date { min-width: 76px; text-align: right; }

body.md-ui .users-listcard .badge {
    padding: 2px 10px;
    border: 0;
    border-radius: var(--md-shape-sm);
    font: 500 12px/18px var(--md-font-sans);
    letter-spacing: .2px;
}
body.md-ui .badge-role-superadmin { background: var(--md-error-container); color: var(--md-on-error-container); }
body.md-ui .badge-role-admin { background: var(--md-reserved-container); color: var(--md-on-reserved-container); }
body.md-ui .badge-role-owner { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
body.md-ui .badge-role-manager { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
body.md-ui .badge-role-server { background: var(--md-surface-container-highest, rgba(127, 127, 127, .2)); color: var(--md-on-surface, inherit); }
body.md-ui .users-listcard .badge-active { background: var(--md-free-container); color: var(--md-on-free-container); }
body.md-ui .users-listcard .badge-blocked { background: var(--md-error-container); color: var(--md-on-error-container); }
body.md-ui .users-listcard .badge-unverified { background: var(--md-surface-container-highest); color: var(--md-on-surface-variant); }

body.md-ui .users-listcard .user-actions {
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    min-width: 132px;
    justify-content: flex-end;
}
body.md-ui .users-listcard .user-actions .user-btn {
    width: auto !important;
    height: 32px;
    padding: 0 14px !important;
    font-size: 13px;
}
body.md-ui .users-listcard .user-actions .user-btn-delete {
    width: 40px !important;
    height: 40px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: transparent !important;
    color: var(--md-on-surface-variant) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.md-ui .users-listcard .user-actions .user-btn-delete:hover:not(:disabled) {
    background: var(--md-error-container) !important;
    color: var(--md-on-error-container) !important;
}
body.md-ui .users-listcard .user-row.blocked { opacity: 1; }
body.md-ui .users-listcard .user-row.blocked .user-email { color: var(--md-on-surface-variant); }

@media (max-width: 1100px) {
    body.md-ui .users-layout { grid-template-columns: minmax(0, 1fr); }
    body.md-ui .users-listcard .user-row { flex-wrap: wrap; }
    body.md-ui .users-listcard .user-meta { flex-wrap: wrap; }
}

/* ==========================================================================
   Widget editor page (M3 finishing). Scoped to .we-page: the Widget window
   of restaurants.html shares widget-editor.css and its class names.
   ========================================================================== */
body.md-ui .we-page .page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
body.md-ui .we-page .we-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 12px;
    border: 0;
    border-radius: var(--md-shape-full);
    background: transparent;
    color: var(--md-primary);
    font: 500 14px/20px var(--md-font-sans);
    cursor: pointer;
}
body.md-ui .we-page .we-back:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
body.md-ui .we-page .we-back .md-icon { font-size: 18px; }
body.md-ui .we-page .we-titles { display: flex; flex-direction: column; min-width: 0; }
body.md-ui .we-page .page-title {
    margin: 0;
    font: 400 24px/32px var(--md-font-sans);
    color: var(--md-on-surface);
}
body.md-ui .we-page .restaurant-name {
    font-size: 14px;
    color: var(--md-on-surface-variant);
}

/* Two columns: settings card, then preview and code */
body.md-ui .we-page .widget-editor {
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    height: auto;
    overflow: visible;
    align-items: start;
}
@media (max-width: 1000px) {
    body.md-ui .we-page .widget-editor { grid-template-columns: minmax(0, 1fr); }
}
body.md-ui .we-page .settings-panel,
body.md-ui .we-page .we-preview-card,
body.md-ui .we-page .code-section {
    background: var(--md-surface-container-low);
    border: 0;
    border-radius: var(--md-shape-lg);
    padding: 20px;
    max-height: none;
    overflow: visible;
}
body.md-ui .we-page .settings-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
body.md-ui .we-page .settings-section { padding: 0 !important; }
body.md-ui .we-page .settings-title,
body.md-ui .we-page .code-title,
body.md-ui .we-page .preview-title {
    font: 500 12px/16px var(--md-font-sans);
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--md-on-surface-variant);
    padding: 0 0 8px 0 !important;
}

/* Layout and theme: segmented buttons over the real radio inputs */
body.md-ui .we-page .radio-group {
    flex-direction: row;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-shape-full);
    overflow: hidden;
}
body.md-ui .we-page .radio-item {
    position: relative;
    flex: 1 1 0;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-left: 1px solid var(--md-outline);
    border-radius: 0;
    background: transparent;
    color: var(--md-on-surface);
}
body.md-ui .we-page .radio-item:first-child { border-left: 0; }
body.md-ui .we-page .radio-item:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
body.md-ui .we-page .radio-item.selected {
    background: var(--md-secondary-container);
    color: var(--md-on-secondary-container);
}
body.md-ui .we-page .radio-item.selected::before {
    content: "check";
    font-family: var(--md-font-icons);
    font-size: 18px;
    line-height: 1;
    font-feature-settings: "liga";
}
body.md-ui .we-page .radio-item:focus-within {
    outline: 2px solid var(--md-primary);
    outline-offset: -2px;
}
/* The radio stays in the page for the keyboard and screen readers. */
body.md-ui .we-page .radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
body.md-ui .we-page .radio-label { flex: 0 1 auto; text-align: center; }
body.md-ui .we-page .radio-label-main { font: 500 14px/20px var(--md-font-sans); }
body.md-ui .we-page .radio-label-sub { display: none; }

/* Colours: swatch, name, hex code */
body.md-ui .we-page .color-row {
    gap: 12px;
    padding: 4px 0;
}
body.md-ui .we-page .color-picker-wrap { display: contents; }
body.md-ui .we-page .color-picker {
    order: 0;
    flex: 0 0 40px;
    width: 40px !important;
    height: 40px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: var(--md-shape-md);
}
body.md-ui .we-page .color-picker::-webkit-color-swatch {
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-md);
}
body.md-ui .we-page .color-picker::-moz-color-swatch {
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--md-shape-md);
}
body.md-ui .we-page .color-label {
    order: 1;
    flex: 1 1 auto;
    width: auto;
    font-size: 14px;
    color: var(--md-on-surface);
}
body.md-ui .we-page .color-hex {
    order: 2;
    width: 76px !important;
    font-size: 12px !important;
    color: var(--md-on-surface-variant) !important;
    background: transparent !important;
    border: 0 !important;
    text-align: right;
    padding: 0 !important;
}

/* Options: plain checkbox lines */
body.md-ui .we-page .checkbox-item,
body.md-ui .we-page .checkbox-item.active {
    gap: 12px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
}
body.md-ui .we-page .checkbox-item:hover { background: transparent; }
body.md-ui .we-page .checkbox-item input[type="checkbox"] { width: 18px; height: 18px; }
body.md-ui .we-page .checkbox-label { font-size: 14px; color: var(--md-on-surface); }

body.md-ui .we-page .we-reset {
    align-self: flex-start;
    width: auto !important;
    margin: 0;
    padding: 0 16px 0 12px !important;
}
body.md-ui .we-page .we-reset::before {
    content: "restart_alt";
    font-family: var(--md-font-icons);
    font-size: 18px;
    line-height: 1;
    font-weight: normal;
    margin-right: 8px;
    vertical-align: -4px;
    font-feature-settings: "liga";
}

/* Preview card, then code card */
body.md-ui .we-page .preview-panel {
    background: transparent;
    border: 0;
    padding: 0;
    gap: 16px;
    overflow: visible;
    max-height: none;
}
body.md-ui .we-page .we-preview-card { background: var(--md-surface-container-highest); }
body.md-ui .we-page .preview-header { margin-bottom: 12px; }
body.md-ui .we-page .preview-title { padding: 0 !important; }
body.md-ui .we-page .preview-size {
    padding: 2px 10px;
    border-radius: var(--md-shape-sm);
    background: var(--md-surface-container-high);
    color: var(--md-on-surface-variant);
    font: 500 12px/18px var(--md-font-sans);
}
body.md-ui .we-page .preview-container {
    background: transparent;
    border: 0;
    padding: 0;
}
body.md-ui .we-page .preview-frame {
    border: 0;
    border-radius: 20px;
    box-shadow: none;
    overflow: hidden;
}

body.md-ui .we-page .code-section {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
body.md-ui .we-page .code-header { margin: 0; }
body.md-ui .we-page .code-title { padding: 0 !important; }
body.md-ui .we-page .code-textarea {
    min-height: 72px;
    padding: 12px;
    border: 0;
    border-radius: var(--md-shape-md);
    background: var(--md-surface-container);
    color: var(--md-on-surface-variant);
    font: 12px/1.5 'Consolas', 'Monaco', monospace;
    resize: vertical;
}
body.md-ui .we-page .we-code-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
body.md-ui .we-page .btn-save,
body.md-ui .we-page .btn-copy {
    height: 40px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--md-shape-full);
    font: 500 14px/20px var(--md-font-sans);
}
body.md-ui .we-page .btn-save { background: var(--md-primary); color: var(--md-on-primary); }
body.md-ui .we-page .btn-save:hover { background: color-mix(in srgb, var(--md-on-primary) 8%, var(--md-primary)); }
body.md-ui .we-page .btn-copy {
    padding-left: 16px;
    background: var(--md-secondary-container);
    color: var(--md-on-secondary-container);
}
body.md-ui .we-page .btn-copy:hover { background: color-mix(in srgb, var(--md-on-secondary-container) 8%, var(--md-secondary-container)); }
body.md-ui .we-page .btn-copy::before {
    content: "content_copy";
    font-family: var(--md-font-icons);
    font-size: 18px;
    line-height: 1;
    font-weight: normal;
    margin-right: 8px;
    vertical-align: -4px;
    font-feature-settings: "liga";
}
body.md-ui .we-page .btn-save.saved,
body.md-ui .we-page .btn-copy.copied {
    background: var(--md-free-container);
    color: var(--md-on-free-container);
}

/* Widget editor page: the ivory theme of theme.css styles these same classes
   with !important, so the M3 values are forced here, for both themes. */
body.md-ui .we-page .settings-section { border-bottom: 0 !important; }
body.md-ui .we-page .settings-title,
body.md-ui .we-page .code-title,
body.md-ui .we-page .preview-header .preview-title { color: var(--md-on-surface-variant) !important; }
body.md-ui .we-page .radio-item {
    background: transparent !important;
    border: 0 !important;
    border-left: 1px solid var(--md-outline) !important;
}
body.md-ui .we-page .radio-item:first-child { border-left: 0 !important; }
body.md-ui .we-page .radio-item.selected { background: var(--md-secondary-container) !important; }
body.md-ui .we-page .radio-item span,
body.md-ui .we-page .radio-item div { color: inherit !important; }
body.md-ui .we-page .radio-item.selected { color: var(--md-on-secondary-container) !important; }
body.md-ui .we-page .checkbox-item,
body.md-ui .we-page .checkbox-item.active {
    background: transparent !important;
    border: 0 !important;
}
body.md-ui .we-page .checkbox-item span,
body.md-ui .we-page .color-row span,
body.md-ui .we-page .color-label { color: var(--md-on-surface) !important; }
body.md-ui .we-page .color-picker {
    border: 0 !important;
    box-shadow: none !important;
}
body.md-ui .we-page .color-hex {
    border: 0 !important;
    box-shadow: none !important;
    outline: none;
    color: var(--md-on-surface-variant) !important;
}
body.md-ui .we-page .btn-back.we-back {
    background: transparent !important;
    border: 0 !important;
    color: var(--md-primary) !important;
}
body.md-ui .we-page .settings-panel button.we-reset {
    background: transparent !important;
    border: 1px solid var(--md-outline) !important;
    color: var(--md-primary) !important;
}
body.md-ui .we-page .btn-copy {
    border: 0 !important;
    background: var(--md-secondary-container) !important;
    color: var(--md-on-secondary-container) !important;
}
body.md-ui .we-page .btn-save.saved,
body.md-ui .we-page .btn-copy.copied {
    background: var(--md-free-container) !important;
    color: var(--md-on-free-container) !important;
}
body.md-ui .we-page .preview-size {
    background: var(--md-surface-container-high) !important;
    color: var(--md-on-surface-variant) !important;
    border: 0 !important;
}
body.md-ui .we-page .preview-frame {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 20px !important;
}
body.md-ui .we-page .preview-frame iframe { border-radius: 20px !important; }

/* Widget editor page, third pass: panels, colour labels and hex fields. */
body.md-ui .we-page .settings-panel,
body.md-ui .we-page .code-section {
    background: var(--md-surface-container-low) !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.md-ui .we-page .preview-panel {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.md-ui .we-page .we-preview-card { background: var(--md-surface-container-highest) !important; }
body.md-ui .we-page .preview-container { background: transparent !important; }
body.md-ui .we-page .color-row span,
body.md-ui .we-page .color-label {
    background: none !important;
    border: 0 !important;
}
body.md-ui .we-page .color-hex { background-color: transparent !important; }

/* Widget editor page, fourth pass: more specific input rules painted these. */
body.md-ui .we-page .color-row input.color-hex,
body.md-ui .we-page .color-row input.color-hex:focus {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
body.md-ui .we-page .code-area textarea.code-textarea {
    background: var(--md-surface-container) !important;
    color: var(--md-on-surface-variant) !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.md-ui .we-page .preview-container .preview-frame { background: transparent !important; }

/* Widget editor, fifth pass: seven layouts as cards, eight theme swatches,
   hints, and the floating button sample in the preview. */
body.md-ui .we-page #layoutGroup {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 0 !important;
    border-radius: 0;
    overflow: visible;
}
body.md-ui .we-page #layoutGroup .radio-item,
body.md-ui .we-page #layoutGroup .radio-item:first-child {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    min-height: 0;
    padding: 10px 12px 10px 14px !important;
    border: 1px solid var(--md-outline-variant) !important;
    border-radius: 12px !important;
    text-align: left;
}
body.md-ui .we-page #layoutGroup .radio-item.selected {
    border-color: var(--md-secondary-container) !important;
}
body.md-ui .we-page #layoutGroup .radio-item.selected::before {
    position: absolute;
    top: 8px;
    right: 8px;
}
body.md-ui .we-page #layoutGroup .radio-label { text-align: left; padding-right: 18px; }
body.md-ui .we-page #layoutGroup .radio-label-sub {
    display: block;
    font: 400 12px/16px var(--md-font-sans);
    opacity: .8;
}
body.md-ui .we-page .we-subtitle {
    grid-column: 1 / -1;
    margin: 4px 0 8px;
    font: 500 12px/16px var(--md-font-sans);
    letter-spacing: .04em;
    color: var(--md-on-surface-variant);
}
body.md-ui .we-page #layoutGroup .we-subtitle { margin: 8px 0 0; }
body.md-ui .we-page .we-hint {
    margin: 0 0 10px;
    font: 400 13px/18px var(--md-font-sans);
    color: var(--md-on-surface-variant);
}
body.md-ui .we-page .we-hint[hidden],
body.md-ui .we-page .color-row[hidden] { display: none !important; }

/* Theme swatches */
body.md-ui .we-page .we-themes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 8px;
}
body.md-ui .we-page .we-theme {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 2px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--md-on-surface);
}
body.md-ui .we-page .we-theme:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
body.md-ui .we-page .we-theme input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
body.md-ui .we-page .we-theme:focus-within { outline: 2px solid var(--md-primary); outline-offset: 0; }
body.md-ui .we-page .we-sw {
    position: relative;
    display: block;
    width: 100%;
    max-width: 64px;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-on-surface) 18%, transparent);
    overflow: hidden;
}
body.md-ui .we-page .we-sw i {
    position: absolute;
    left: 10%;
    bottom: 14%;
    width: 46%;
    height: 22%;
    border-radius: 999px;
}
body.md-ui .we-page .we-sw b {
    position: absolute;
    left: 10%;
    top: 16%;
    width: 60%;
    height: 10%;
    border-radius: 999px;
    opacity: .85;
}
body.md-ui .we-page .we-theme.selected .we-sw {
    box-shadow: 0 0 0 2px var(--md-surface-container-low), 0 0 0 4px var(--md-primary);
}
body.md-ui .we-page .we-th-name {
    font: 500 12px/16px var(--md-font-sans);
    text-align: center;
    color: var(--md-on-surface) !important;
}
body.md-ui .we-page .we-theme.selected .we-th-name { color: var(--md-primary) !important; }

/* Preview extras */
body.md-ui .we-page .we-fab-demo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}
body.md-ui .we-page .we-fab-demo[hidden],
body.md-ui .we-page .we-backbar[hidden] { display: none !important; }
body.md-ui .we-page .we-fab-demo-text {
    font: 400 13px/18px var(--md-font-sans);
    color: var(--md-on-surface-variant);
}
body.md-ui .we-page .we-fab-btn {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border-radius: 22px;
    font: 600 14px/1 var(--md-font-sans);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
body.md-ui .we-page .we-backbar {
    display: inline-flex;
    align-items: center;
    height: 36px;
    margin: 0 0 10px;
    padding: 0 16px;
    border: 1px solid var(--md-outline) !important;
    border-radius: 18px;
    background: transparent !important;
    color: var(--md-primary) !important;
    font: 500 14px/1 var(--md-font-sans);
    cursor: pointer;
}
@media (max-width: 420px) {
    body.md-ui .we-page #layoutGroup { grid-template-columns: minmax(0, 1fr); }
}

/* Widget modal (restaurants.html): same seven layouts and eight theme
   swatches as the widget editor page, sized for the modal column. */
body.md-ui #modalWidget .widget-editor { grid-template-columns: 300px minmax(0, 1fr); }
@media (max-width: 900px) {
    body.md-ui #modalWidget .widget-editor { grid-template-columns: minmax(0, 1fr); }
}
body.md-ui #modalWidget .settings-panel { padding: 8px 10px; }
body.md-ui #modalWidget .settings-title { font-size: 11px; padding: 0 0 6px 0 !important; }
body.md-ui #modalWidget .settings-section { padding: 10px 0 0 0 !important; }
body.md-ui #modalWidget #weLayoutGroup {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    border: 0 !important;
    overflow: visible;
}
body.md-ui #modalWidget #weLayoutGroup .radio-item,
body.md-ui #modalWidget #weLayoutGroup .radio-item:first-child {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 0;
    padding: 8px 28px 8px 12px !important;
    border: 1px solid var(--md-outline-variant) !important;
    border-radius: 12px !important;
    text-align: left;
}
body.md-ui #modalWidget #weLayoutGroup .radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
body.md-ui #modalWidget #weLayoutGroup .radio-item.selected {
    border-color: var(--md-primary) !important;
    background: var(--md-secondary-container) !important;
    color: var(--md-on-secondary-container) !important;
}
body.md-ui #modalWidget #weLayoutGroup .radio-item.selected::after {
    content: "\2713";
    position: absolute;
    top: 8px;
    right: 10px;
    font: 700 13px/1 var(--md-font-sans);
    color: var(--md-primary);
}
body.md-ui #modalWidget #weLayoutGroup .radio-label-main { font: 500 13px/18px var(--md-font-sans); }
body.md-ui #modalWidget #weLayoutGroup .radio-label-sub {
    display: block;
    font: 400 11px/15px var(--md-font-sans);
    opacity: .8;
}
body.md-ui #modalWidget .we-subtitle {
    margin: 2px 0 6px;
    font: 500 11px/16px var(--md-font-sans);
    letter-spacing: .04em;
    color: var(--md-on-surface-variant);
}
body.md-ui #modalWidget #weLayoutGroup .we-subtitle { margin: 6px 0 0; }
body.md-ui #modalWidget .we-hint {
    margin: 0 0 8px;
    font: 400 12px/16px var(--md-font-sans);
    color: var(--md-on-surface-variant);
}
body.md-ui #modalWidget .we-hint[hidden],
body.md-ui #modalWidget .color-row[hidden],
body.md-ui #modalWidget .we-fab-demo[hidden],
body.md-ui #modalWidget .we-backbar[hidden] { display: none !important; }
body.md-ui #modalWidget .we-themes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 6px;
}
body.md-ui #modalWidget .we-theme {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--md-on-surface);
}
body.md-ui #modalWidget .we-theme:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
body.md-ui #modalWidget .we-theme input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
body.md-ui #modalWidget .we-theme:focus-within { outline: 2px solid var(--md-primary); outline-offset: 0; }
body.md-ui #modalWidget .we-sw {
    position: relative;
    display: block;
    width: 100%;
    max-width: 56px;
    aspect-ratio: 4 / 3;
    border-radius: 9px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md-on-surface) 18%, transparent);
    overflow: hidden;
}
body.md-ui #modalWidget .we-sw i {
    position: absolute;
    left: 10%;
    bottom: 14%;
    width: 46%;
    height: 22%;
    border-radius: 999px;
}
body.md-ui #modalWidget .we-sw b {
    position: absolute;
    left: 10%;
    top: 16%;
    width: 60%;
    height: 10%;
    border-radius: 999px;
    opacity: .85;
}
body.md-ui #modalWidget .we-theme.selected .we-sw {
    box-shadow: 0 0 0 2px var(--md-surface-container-low), 0 0 0 4px var(--md-primary);
}
body.md-ui #modalWidget .we-th-name {
    font: 500 11px/14px var(--md-font-sans);
    text-align: center;
    color: var(--md-on-surface) !important;
}
body.md-ui #modalWidget .we-theme.selected .we-th-name { color: var(--md-primary) !important; }
body.md-ui #modalWidget .we-fab-demo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}
body.md-ui #modalWidget .we-fab-demo-text {
    font: 400 13px/18px var(--md-font-sans);
    color: var(--md-on-surface-variant);
}
body.md-ui #modalWidget .we-fab-btn {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border-radius: 22px;
    font: 600 14px/1 var(--md-font-sans);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
body.md-ui #modalWidget .we-backbar {
    display: inline-flex;
    align-items: center;
    height: 36px;
    margin: 0 0 10px;
    padding: 0 16px;
    border: 1px solid var(--md-outline) !important;
    border-radius: 18px;
    background: transparent !important;
    color: var(--md-primary) !important;
    font: 500 14px/1 var(--md-font-sans);
    cursor: pointer;
}


/* Administration > Plans (20.09.2026): the plan contents grid. */
body.md-ui #mdPlans .ro-modal { max-width: 960px !important; }
body.md-ui #mdPlans .pf-hint { margin: 0 0 14px; }
body.md-ui #mdPlans .pf-grid { overflow-x: auto; }
body.md-ui #mdPlans .pf-table { width: 100%; border-collapse: collapse; }
body.md-ui #mdPlans .pf-table th,
body.md-ui #mdPlans .pf-table td {
    padding: 4px 12px;
    border-bottom: 1px solid var(--md-outline-variant);
    text-align: left;
    font: 400 14px/20px var(--md-font-sans);
    color: var(--md-on-surface);
}
body.md-ui #mdPlans .pf-table th { font-weight: 600; vertical-align: bottom; }
body.md-ui #mdPlans .pf-plan,
body.md-ui #mdPlans .pf-cell { text-align: center; width: 120px; }
body.md-ui #mdPlans .pf-plan-name { display: block; }
body.md-ui #mdPlans .pf-plan-count {
    display: block;
    font: 400 12px/16px var(--md-font-sans);
    color: var(--md-on-surface-variant);
}
body.md-ui #mdPlans .pf-box { width: 18px; height: 18px; min-height: 0 !important; margin: 0; vertical-align: middle; accent-color: var(--md-primary); cursor: pointer; }
/* Tighter rows (26.09.2026, Greg: "diminuer les interlignes"). */
body.md-ui #mdPlans .pf-table tbody td { height: 30px; }
body.md-ui #mdPlans .pf-table thead th { padding-top: 8px; padding-bottom: 8px; }
body.md-ui #mdPlans .pf-hist-title { margin-top: 20px; }
body.md-ui #mdPlans .pf-history { max-height: 220px; overflow-y: auto; }
body.md-ui #mdPlans .pf-hist-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--md-outline-variant);
    font: 400 13px/18px var(--md-font-sans);
    color: var(--md-on-surface);
}
body.md-ui #mdPlans .pf-hist-when,
body.md-ui #mdPlans .pf-hist-by { color: var(--md-on-surface-variant); }
body.md-ui #mdPlans .pf-hist-what.is-removed { color: var(--md-error); }
/* Confirmation boxes may list several changes, one per line. */
.confirm-dialog-text { white-space: pre-line; }



/* Automatic messages card (20.09.2026) and the "confirmed by guest" mark. */
body.md-ui .fo-card .fo-hint { margin: 0 0 8px; font: 400 12px/16px var(--md-font-sans); color: var(--md-on-surface-variant); }
body.md-ui .fo-card .fo-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 0; border-top: 1px solid var(--md-outline-variant); cursor: pointer;
}
body.md-ui .fo-card .fo-row.is-excluded { opacity: .55; cursor: default; }
body.md-ui .fo-card .fo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body.md-ui .fo-card .fo-label { font: 500 14px/20px var(--md-font-sans); color: var(--md-on-surface); }
body.md-ui .fo-card .fo-desc { font: 400 12px/16px var(--md-font-sans); color: var(--md-on-surface-variant); }
body.md-ui .fo-card .fo-switch {
    appearance: none; -webkit-appearance: none; flex: none;
    width: 44px; height: 24px; border-radius: 12px; position: relative; cursor: pointer;
    background: var(--md-surface-container-highest); box-shadow: inset 0 0 0 2px var(--md-outline);
    transition: background .15s;
}
body.md-ui .fo-card .fo-switch::after {
    content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--md-outline); transition: transform .15s, background .15s;
}
body.md-ui .fo-card .fo-switch:checked { background: var(--md-primary); box-shadow: none; }
body.md-ui .fo-card .fo-switch:checked::after { transform: translateX(20px); background: var(--md-on-primary); }
body.md-ui .fo-card .fo-switch:disabled { cursor: not-allowed; opacity: .6; }
/* The directory card of the sheet (js/directory-card.js, v126): what the box gives. */
body.md-ui .dir-card-sheet .dir-card-status { margin: 4px 0 8px; font: 400 13px/18px var(--md-font-sans); color: var(--md-on-surface-variant); }
body.md-ui .dir-card-sheet .dir-card-status.is-on { color: var(--md-free); }
body.md-ui .dir-card-sheet .dir-card-status a { color: var(--md-primary); }
/* "Restaurant de test" on the Administration sheet (js/test-restaurant-admin.js, v127). */
body.md-ui .rs-test-flag { margin: 14px 0 4px; }
body.md-ui .rs-test-flag .rs-test-row { display: flex; align-items: center; gap: 8px; font: 500 14px/20px var(--md-font-sans); color: var(--md-on-surface); cursor: pointer; }
body.md-ui .rs-test-flag .rs-test-hint { margin: 4px 0 0; font: 400 12px/16px var(--md-font-sans); color: var(--md-on-surface-variant); }
body.md-ui .res-guest-confirmed {
    display: inline-flex; align-items: center; height: 20px; margin-left: 6px; padding: 0 8px; border-radius: 10px;
    font: 600 11px/1 var(--md-font-sans); white-space: nowrap; vertical-align: middle;
    background: var(--md-primary-container, #ffdea6); color: var(--md-on-primary-container, #271900);
}

/* ---- restaurant sheet sections (26.09.2026) ---- */
/* The cards of the restaurant sheet ranked by subject, a title above each
   group (js/fiche-sections.js). The title spans the whole grid row. */
body.md-ui #cardsGrid.has-sections > .fiche-section-title {
    grid-column: 1 / -1;
    margin: 16px 0 -4px;
    padding: 0 4px;
    font: 500 14px/20px var(--md-font-sans);
    letter-spacing: .1px;
    color: var(--md-on-surface-variant);
}
body.md-ui #cardsGrid.has-sections > .fiche-section-title:first-child {
    margin-top: 0;
}
body.md-ui #cardsGrid.has-sections > .fiche-section-title[hidden] {
    display: none;
}

/* ---- rooms edited in the plan (26.09.2026) ---- */
/* The "+" tab adds a room; the tabs are dragged to set the fill order
   (js/md-room-tabs.js, edit mode). */
body.md-ui .md-room-tabs.is-editable .md-room-tab[data-room-id] {
    cursor: grab;
    touch-action: none;
}
body.md-ui .md-room-tabs .md-room-tab.dragging {
    cursor: grabbing;
    opacity: .6;
}
body.md-ui .md-room-tabs .md-room-tab-add {
    min-width: 40px;
    justify-content: center;
}
body.md-ui #mdNewRoom .nr-msg,
body.md-ui #mdCancelReason .nr-msg {
    margin: 8px 0 0;
    min-height: 20px;
    color: var(--md-error);
    font: 400 13px/20px var(--md-font-sans);
}

/* The reason for a cancellation (26.09.2026): the booking it is about. */
body.md-ui #mdCancelReason .cr-who { margin: 0 0 12px; font-weight: 500; }
body.md-ui #mdCancelReason textarea { width: 100%; box-sizing: border-box; resize: vertical; }

/* The team (26.09.2026): the role of each person, and no Team card for a
   Manager without the floor-team box. */
.team-role { display: inline-block; margin: 0 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; line-height: 16px; background: var(--md-sys-color-secondary-container, rgba(127, 127, 127, .15)); color: var(--md-sys-color-on-secondary-container, inherit); }
/* The member's own line in the team (27.09.2026): "Vous", read only. */
.team-self { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; line-height: 16px; font-weight: 600; background: var(--md-sys-color-primary-container, rgba(127, 127, 127, .2)); color: var(--md-sys-color-on-primary-container, inherit); }
.list-item.is-self .mgr-perm-label { opacity: .7; }
/* The role as a choice (27.09.2026): the chip, with an arrow. The window's
   field rules (48 px, outline, transparent) are set aside for it. */
body.md-ui select.team-role-select,
body.md-ui .ro-modal select.team-role-select {
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    margin: 0 6px;
    padding: 1px 22px 1px 8px !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-family: inherit;
    font-size: 11px !important;
    line-height: 16px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    color: var(--md-sys-color-on-secondary-container, var(--md-on-surface)) !important;
    background: linear-gradient(45deg, transparent 50%, currentColor 50%) calc(100% - 12px) 50% / 4px 4px no-repeat,
                linear-gradient(135deg, currentColor 50%, transparent 50%) calc(100% - 8px) 50% / 4px 4px no-repeat,
                var(--md-sys-color-secondary-container, rgba(127, 127, 127, .15)) !important;
}
body.md-ui .ro-modal select.team-role-select:focus-visible {
    outline: 2px solid var(--md-primary) !important;
    outline-offset: 1px;
    border: 0 !important;
}
body.md-ui .ro-modal select.team-role-select:focus:not(:focus-visible) { border: 0 !important; }
body.md-ui select.team-role-select:disabled { opacity: .6; cursor: default; }
body.mgr-role #cardManagers { display: none !important; }

/* The terrace reserve card shows the window's gauge, read only (27.09.2026). */
.sc-buffer-gauge { margin-top: 8px; }
.sc-buffer-gauge .buffer-slider,
.sc-buffer-gauge .buffer-slider:disabled {
    pointer-events: none;
    cursor: default;
    opacity: 1;
}
.sc-buffer-gauge .buffer-slider::-webkit-slider-thumb { cursor: default; }

/* The Site web card: the site used, and a miniature of our page (27.09.2026). */
body.md-ui .ws-card-kind { font-weight: 600; margin-bottom: 2px; }
body.md-ui .ws-card-url {
    font: 13px/18px ui-monospace, Consolas, monospace;
    color: var(--md-primary);
    overflow-wrap: anywhere;
}
body.md-ui .ws-card-line { margin-top: 6px; font-size: 13px; }
body.md-ui .ws-card-thumb {
    position: relative;
    margin-top: 10px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--md-outline-variant, #d8cbb8);
    background: var(--md-surface, #fff);
}
body.md-ui .ws-card-thumb iframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 960px;
    border: 0;
    transform-origin: 0 0;
    transform: scale(0.2);
    pointer-events: none;
}
