/*
 * Shared CMS visual tokens. Two families:
 *  - Accent (--cms-gold*): the operator's saved branding colour. The
 *    literal values below are only the pre-render/no-JS fallback --
 *    marie_cms_branding_theme_css() (includes/branding.php) overrides all
 *    four --cms-gold* custom properties (including the RGB triplet, needed
 *    for an alpha-blended focus ring) via a same-origin stylesheet loaded
 *    right after this one, CSP-safely (no inline <style>).
 *  - Neutral surfaces/text/shadows/radii: matched directly to the
 *    reference DAT Consulting CMS's own tokens (dat-cms/admin-ui/assets/
 *    admin.css :root), never to Marie's old warm public-site palette --
 *    the CMS shell is its own shared presentation, independent of project
 *    branding. --cms-cream is the one exception, kept as Marie's existing
 *    warm soft-fill for internal detail/hover backgrounds (the reference
 *    CMS's own equivalent, --cms-accent-soft, is likewise accent-tinted
 *    rather than neutral).
 */
:root {
    color-scheme: light;
    --cms-gold: #d4a437;
    --cms-gold-dark: #875a16;
    --cms-gold-light: #f3e3b6;
    --cms-gold-rgb: 212, 164, 55;
    --cms-charcoal: #1b1e24;
    --cms-charcoal-soft: #171a20;
    --cms-cream: #f6f0e5;
    --cms-ivory: #f5f6f8;
    --cms-white: #ffffff;
    --cms-border: #dfe2e7;
    --cms-border-strong: #c7cbd2;
    --cms-muted: #69707d;
    --cms-error: #b23d3d;
    --cms-success: #34765a;
    --cms-focus: var(--cms-gold);
    --cms-radius-sm: 0.45rem;
    --cms-radius: 0.75rem;
    --cms-radius-lg: 1rem;
    --cms-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --cms-shadow: 0 8px 24px rgba(16, 24, 40, 0.07);
    --cms-shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.14);
}

.cms-table-wrap { overflow-x: auto; }
.cms-table { width: 100%; border-collapse: collapse; }
.cms-table th, .cms-table td { padding: 0.78rem 1rem; border-bottom: 1px solid var(--cms-border); text-align: left; vertical-align: middle; }
.cms-table th { background: #f8f9fa; color: #505764; font-size: 0.72rem; letter-spacing: 0.035em; text-transform: uppercase; }
.cms-table .cms-button { white-space: nowrap; }
.cms-resource-name-link { color: var(--cms-gold-dark); text-decoration-thickness: 0.08em; text-underline-offset: 0.16em; }
.cms-resource-name-link:hover { color: var(--cms-charcoal); }
/*
 * auto-fit rather than a fixed repeat(3, ...): the catalogue hub
 * (accommodations.php) now links out to four peer sections (Ceny,
 * Vybavení, Veřejné názvy, Fotografie), and a fixed 3-column track would
 * leave the fourth tile alone on its own row at every desktop width.
 * auto-fit naturally settles at 4-across on wide desktop screens and
 * fewer, evenly-sized columns as the viewport narrows, with no per-tile-
 * count breakpoint to maintain.
 */
.cms-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.cms-module-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 6rem;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 150ms, border-color 150ms;
}
.cms-module-link:hover { border-color: #a78648; box-shadow: var(--cms-shadow); }
.cms-inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.cms-inline-form label { display: grid; gap: 0.35rem; }
.cms-copy-row { display: flex; gap: 0.5rem; align-items: center; }
.cms-copy-row input { flex: 1 1 auto; min-width: 0; }
.cms-seasonal-row { padding-top: 1rem; border-top: 1px solid var(--cms-border, #ddd4c5); }
.cms-seasonal-heading { flex-basis: 100%; margin-bottom: 0.25rem; }
.cms-seasonal-create .cms-check-row { min-height: 3rem; }
/*
 * A seasonal price the operator has deactivated (the checkbox in this
 * same row unchecked and saved). Marked with a left accent rather than
 * dimming the row's opacity -- an opacity-based "inactive" treatment
 * reads, at a glance, uncomfortably close to the same rule this project
 * already uses for genuinely disabled/unusable controls
 * (.cms-button:disabled), which a merely-deactivated-but-still-fully-
 * editable price row is not.
 */
.cms-seasonal-row.is-inactive { border-left: 3px solid var(--cms-border-strong); padding-left: 0.75rem; background: var(--cms-cream); }
/*
 * Three-plus columns at ordinary desktop widths instead of a hard-coded
 * repeat(2, ...): auto-fill keeps every checkbox column at a readable
 * minimum (18rem comfortably fits the longest real amenity label,
 * "Společná vybavená kuchyně", on one line) while using the available
 * 1280-1920px width instead of leaving it mostly blank.
 */
.cms-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.75rem; }
.cms-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.cms-tabs a { padding: 0.65rem 0.9rem; border: 1px solid var(--cms-border, #ddd4c5); border-radius: 999px; color: inherit; text-decoration: none; background: #fff; }
.cms-tabs a[aria-current="page"] { background: #25231f; color: #fff; }
.cms-media-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.cms-media-card { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.75rem 1rem; padding: 0.85rem; border: 1px solid var(--cms-border, #ddd4c5); border-radius: 0.75rem; }
.cms-media-card > img { width: 9rem; height: 6.75rem; object-fit: cover; border-radius: 0.5rem; }
.cms-media-card label { display: grid; gap: 0.35rem; }
.cms-media-card > :not(img) { grid-column: 2; }
.cms-rights-fields { display: grid; grid-column: 1 / -1; gap: 0.75rem; padding: 1rem; margin: 0; border: 1px solid var(--cms-border); border-radius: 0.5rem; }
.cms-rights-fields legend { padding-inline: 0.35rem; font-weight: 800; }
.cms-rights-internet-fields { display: grid; grid-template-columns: minmax(9rem, 0.45fr) minmax(0, 1fr); gap: 0.6rem; align-items: center; }
.cms-rights-warning { grid-column: 1 / -1; margin: 0; color: var(--cms-charcoal); background: var(--cms-gold-light); border-left-color: var(--cms-gold-dark); }
.cms-media-card .cms-rights-fields { grid-column: 1 / -1; }

@media (max-width: 800px) {
    .cms-actions-grid, .cms-media-grid, .cms-checkbox-grid { grid-template-columns: 1fr; }
    .cms-rights-internet-fields { grid-template-columns: 1fr; }
    .cms-media-card { grid-template-columns: 1fr; }
    .cms-media-card > img { width: min(100%, 10rem); }
    .cms-media-card > :not(img) { grid-column: 1; }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 20rem;
    color: var(--cms-charcoal);
    background: var(--cms-ivory);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
}

html {
    scroll-padding-top: 5rem;
}

h1,
h2,
p {
    margin-top: 0;
}

/*
 * Compact sans-serif heading hierarchy, matching the reference CMS
 * (Inter/system-sans stack, no external font request -- Gaval itself never
 * loads one either, it only names Inter and falls through to the system
 * stack when unavailable). This used to be Georgia serif, a leftover from
 * the public marketing site's own heading treatment; cms.css is CMS-only
 * (never linked from the public site or from outgoing e-mail HTML, which
 * carry their own inline styles) so this scoped change cannot leak there.
 */
h1,
h2,
h3 {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: -0.018em;
}

h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.65rem, 2.4vw, 2.1rem);
    line-height: 1.2;
}

h2 {
    font-size: 1.18rem;
    line-height: 1.3;
}

h3 {
    margin-top: 0;
    font-size: 1rem;
}

a {
    color: inherit;
}

/*
 * Focus ring, matching the reference CMS exactly (dat-cms/admin-ui/assets/
 * admin.css :root and its input:focus rule) rather than Marie's previous
 * hardcoded solid blue (#155eef), which was unrelated to the accent system
 * and had no separate, higher-specificity rule for form controls -- every
 * focusable element, inputs included, fell back to this one heavy outline.
 * General default: a soft alpha-blended outline. Form controls below get a
 * different, more specific treatment (border colour + a subtle ring)
 * instead, matching the reference CMS's own input:focus rule precisely.
 */
:focus-visible {
    outline: 3px solid rgba(var(--cms-gold-rgb), 0.32);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--cms-gold-dark);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(var(--cms-gold-rgb), 0.14);
}

.cms-reservation-filters,
.cms-reservation-grid,
.cms-reservation-action-grid {
    display: grid;
    gap: 1rem;
}

.cms-reservation-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.cms-reservation-filters .cms-form-actions {
    grid-column: 1 / -1;
}

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

/*
 * Single canonical rule for every status badge, whichever modifier family
 * a page uses (.cms-status-pending/-approved/-rejected/-cancelled/
 * -completed/-other/-new for reservations; .cms-status.is-active/
 * .is-inactive for accounts/pages/homepage sections). This used to be TWO
 * separate, unscoped ".cms-status { ... }" base rules (here, and a second
 * one further down authored later for the is-active/is-inactive family)
 * that silently merged property-by-property via cascade order rather than
 * conflicting outright -- fragile (any future reordering could change the
 * effective result) even though today's merged values happened to be
 * coherent. Consolidated to the exact values that merge already produced,
 * so this is a structural cleanup, not a visual change.
 */
.cms-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    line-height: 1.25;
    font-weight: 800;
    font-size: 0.75rem;
}

.cms-status-pending {
    color: #6e4700;
    background: #fff0c2;
}

.cms-status-approved {
    color: #12542f;
    background: #d8f3e3;
}

.cms-status-rejected,
.cms-status-cancelled {
    color: #7a2525;
    background: #f7dddd;
}

.cms-status-completed,
.cms-status-other {
    color: #334155;
    background: #e8edf3;
}

/* Reservation SOURCE chips (BC-MANUAL-3): where a reservation came from,
 * deliberately distinct from the lifecycle status colours above. */
.cms-status-source-web {
    color: #334155;
    background: #eef1f5;
    border: 1px solid #d5dbe3;
}

.cms-status-source-booking {
    color: #0b3b75;
    background: #e3eefc;
    border: 1px solid #b7cff0;
}

.cms-status-source-direct {
    color: #4b2a63;
    background: #f1e9f7;
    border: 1px solid #d9c6e8;
}

.cms-status-source-other {
    color: #334155;
    background: #ffffff;
    border: 1px dashed #b6bfcc;
}

.cms-reservation-intake {
    color: #5b6472;
    white-space: nowrap;
}

.cms-booking-com-units,
.cms-manual-units {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.cms-booking-com-units .cms-help,
.cms-manual-units .cms-help {
    grid-column: 1 / -1;
}

[data-booking-com-form] h2,
[data-direct-reservation-form] h2 {
    margin: 1.5rem 0 0;
}

[data-booking-com-form] h2:first-of-type,
[data-direct-reservation-form] h2:first-of-type {
    margin-top: 0;
}

.cms-booking-com-units legend,
.cms-manual-units legend {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/*
 * Shared compact layout for the two manual reservation forms
 * (marie-admin/direct-reservation.php, booking-com-reservation.php): a card
 * capped at ~960px, left-aligned, holding a two-column grid of
 * .cms-reservation-field blocks (label above its control, the field's own
 * help text underneath). Headings, alerts, section-level help, the unit
 * fieldset, the internal note and the actions span both columns through the
 * existing .cms-form-wide. The column count follows the card's own width
 * (container query), so a tablet with the sidebar open only gets two
 * columns when they actually fit; the media query is the fallback for
 * browsers without container queries. Public booking forms never use these
 * classes.
 */
.cms-reservation-form-panel {
    max-width: 60rem;
    container-type: inline-size;
}

/*
 * Exactly 50/50: both tracks are minmax(0, 1fr), so no field's content
 * (a long <select> option, a date mirror input) can push its own column
 * wider than the other. --cms-reservation-column-gap is shared with the
 * unit fieldset below so its checkbox columns sit on the same split line.
 */
.cms-reservation-form {
    --cms-reservation-column-gap: 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem var(--cms-reservation-column-gap);
    align-items: start;
}

.cms-reservation-form > p,
.cms-reservation-field > p {
    margin: 0;
}

/*
 * The field's own grid gets an explicit minmax(0, 1fr) track instead of the
 * implicit `auto` one, and every child (label, input, select, textarea,
 * the date picker's .marie-date-field wrapper, help text) min-width: 0, so
 * nothing can overflow the column boundary.
 */
.cms-reservation-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    min-width: 0;
}

.cms-reservation-field > * {
    min-width: 0;
    max-width: 100%;
}

/*
 * Previously repeat(auto-fill, minmax(16rem, 1fr)): about three checkbox
 * columns at desktop width, whose column lines did not fall on the form's
 * 50/50 split and made the two form columns look unequal. Now the same two
 * columns and the same gap as the form itself.
 */
.cms-reservation-form .cms-manual-units,
.cms-reservation-form .cms-booking-com-units {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--cms-reservation-column-gap);
    /* A fieldset defaults to min-inline-size: min-content -- never let it widen the mobile column. */
    min-width: 0;
}

@container (max-width: 34rem) {
    .cms-reservation-form,
    .cms-reservation-form .cms-manual-units,
    .cms-reservation-form .cms-booking-com-units {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 36rem) {
    .cms-reservation-form,
    .cms-reservation-form .cms-manual-units,
    .cms-reservation-form .cms-booking-com-units {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cms-reservation-table tr.is-pending td:first-child {
    border-left: 0.25rem solid #d49a1d;
}

.cms-detail-list,
.cms-price-summary {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.cms-detail-list div,
.cms-price-summary div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.7fr) minmax(0, 1.3fr);
    gap: 1rem;
    padding-block: 0.5rem;
    border-bottom: 1px solid var(--cms-border);
}

.cms-detail-list dt,
.cms-price-summary dt {
    font-weight: 700;
}

.cms-detail-list dd,
.cms-price-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.cms-price-summary {
    max-width: 36rem;
    margin-top: 1.25rem;
}

.cms-price-summary div:nth-last-child(-n + 3) {
    font-size: 1.05rem;
    font-weight: 700;
}

.cms-nightly-prices {
    min-width: 12rem;
    margin: 0;
    padding-left: 1.1rem;
}

.cms-confirm-form {
    display: grid;
    align-content: start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--cms-border);
    border-radius: 0.75rem;
}

.cms-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.cms-alert-warning {
    color: #6e4700;
    background: #fff7dc;
    border-color: #dfb64f;
}

@media (max-width: 64rem) {
    .cms-reservation-table {
        min-width: 72rem;
    }
}

@media (max-width: 48rem) {
    .cms-reservation-filters,
    .cms-reservation-grid,
    .cms-reservation-action-grid {
        grid-template-columns: 1fr;
    }
}

.cms-reservations-page .cms-main,
.cms-reservation-detail-page .cms-main {
    width: 100%;
    max-width: none;
}

.cms-reservations-page .cms-panel,
.cms-reservation-detail-page .cms-panel,
.cms-reservation-detail-sections {
    width: 100%;
    min-width: 0;
}

.cms-reservation-table-wrap {
    max-width: 100%;
    overflow: visible;
}

.cms-reservation-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: calc(0.78rem + 0.5px);
    line-height: 1.35;
}

.cms-reservation-table th,
.cms-reservation-table td {
    padding: 0.5rem 0.4rem;
    overflow-wrap: break-word;
}

.cms-reservation-table th:nth-child(1) { width: 10%; }
.cms-reservation-table th:nth-child(2) { width: 13%; }
.cms-reservation-table th:nth-child(3) { width: 10%; }
.cms-reservation-table th:nth-child(4) { width: 14%; }
.cms-reservation-table th:nth-child(5) { width: 10%; }
.cms-reservation-table th:nth-child(6) { width: 8%; }
.cms-reservation-table th:nth-child(7) { width: 8%; }
.cms-reservation-table th:nth-child(8) { width: 17%; }
.cms-reservation-table th:nth-child(9) { width: 10%; }

.cms-reservation-table .cms-button {
    min-height: 2.4rem;
    padding: 0.45rem 0.6rem;
}

.cms-reservation-table .cms-reservation-reference,
.cms-reservation-table .cms-reservation-stay,
.cms-reservation-table .cms-reservation-created,
.cms-reservation-table .cms-reservation-created small,
.cms-reservation-table .cms-reservation-created span {
    white-space: nowrap;
}

.cms-reservation-table .cms-reservation-reference {
    overflow-wrap: normal;
    white-space: normal;
}

/* Compact source chip under the reference number (BC-MANUAL-3): it must fit
 * the narrow first column without clipping. */
.cms-reservation-table .cms-reservation-reference .cms-status {
    margin-top: 0.2rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.68rem;
    white-space: nowrap;
}

.cms-reservation-table .cms-reservation-stay {
    overflow-wrap: normal;
}

.cms-reservation-table .cms-reservation-accommodation {
    overflow-wrap: break-word;
}

.cms-reservation-table .cms-reservation-created {
    overflow-wrap: normal;
}

.cms-reservation-detail-sections {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.cms-reservation-detail-section {
    min-width: 0;
}

.cms-reservation-detail-page .cms-detail-list {
    grid-template-columns: repeat(3, minmax(14rem, 1fr));
    gap: 0;
}

.cms-reservation-detail-page .cms-detail-list div {
    display: block;
    min-width: 0;
    padding: 0.8rem 1rem 0.8rem 0;
    background: transparent;
    border-bottom: 1px solid var(--cms-border);
    border-radius: 0;
}

.cms-reservation-detail-page .cms-detail-list dt {
    margin-bottom: 0.25rem;
    color: var(--cms-muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.cms-reservation-detail-page .cms-detail-list dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.45;
}

.cms-reservation-detail-page .cms-price-summary div {
    display: block;
}

.cms-reservation-detail-page .cms-price-summary dd {
    margin-top: 0.2rem;
    font-weight: 400;
}

.cms-reservation-detail-page .cms-detail-item-wide {
    grid-column: 1 / -1;
}

/*
 * Reservation detail only (body.cms-reservation-view-page; the invoice,
 * credit-note and e-mail pages share .cms-reservation-detail-page and are
 * untouched): the summaries (price, Platby, Finanční vypořádání, invoice /
 * credit-note summaries) drop the generic 36rem cap of .cms-price-summary so
 * their hairlines run across the whole card. The rows stay stacked
 * (label above value, left-aligned), so the text layout does not change.
 */
.cms-reservation-view-page .cms-price-summary {
    max-width: none;
}

.cms-reservation-information-group {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--cms-border);
}

.cms-reservation-information-group:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.cms-reservation-information-group h3 {
    margin: 0 0 0.35rem;
    color: var(--cms-charcoal);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
}

.cms-reservation-detail-page .cms-detail-value-contact {
    overflow-wrap: break-word;
    word-break: normal;
}

.cms-reservation-detail-page .cms-detail-value-nowrap {
    overflow-wrap: normal;
    white-space: nowrap;
}

.cms-reservation-bottom-navigation {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.cms-reservations-page,
.cms-reservation-detail-page,
.cms-reservations-page .cms-panel,
.cms-reservation-detail-page .cms-panel {
    max-width: 100%;
}

.cms-reservations-page .cms-table-wrap,
.cms-reservation-detail-page .cms-table-wrap {
    overflow: visible;
}

.cms-reservation-resource-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.82rem;
}

.cms-reservation-resource-table th,
.cms-reservation-resource-table td {
    padding: 0.55rem;
    overflow-wrap: break-word;
}

@media (max-width: 72rem) {
    .cms-reservation-detail-page .cms-detail-list {
        grid-template-columns: repeat(2, minmax(14rem, 1fr));
    }
}

@media (max-width: 40rem) {
    .cms-reservation-detail-page .cms-detail-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .cms-reservation-detail-page .cms-detail-value-nowrap {
        white-space: normal;
    }

    .cms-reservation-bottom-navigation .cms-button {
        width: 100%;
    }
}

@media (max-width: 52rem) {
    /*
     * .cms-reservation-payments-table (marie-admin/reservation.php's
     * payment-records table) added to this existing group: it already
     * carried the same data-label attributes and, via the page-scoped
     * .cms-reservation-detail-page .cms-table-wrap rule below, the same
     * disabled horizontal scroll -- but was never added to this selector
     * list, so it got neither the horizontal-scroll fallback NOR this
     * card-collapse at narrow widths, a genuine pre-existing gap.
     */
    .cms-reservation-table,
    .cms-reservation-table tbody,
    .cms-reservation-table tr,
    .cms-reservation-table td,
    .cms-reservation-resource-table,
    .cms-reservation-resource-table tbody,
    .cms-reservation-resource-table tr,
    .cms-reservation-resource-table td,
    .cms-reservation-payments-table,
    .cms-reservation-payments-table tbody,
    .cms-reservation-payments-table tr,
    .cms-reservation-payments-table td {
        display: block;
        width: 100%;
    }

    .cms-reservation-table thead,
    .cms-reservation-resource-table thead,
    .cms-reservation-payments-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .cms-reservation-table tr,
    .cms-reservation-resource-table tr,
    .cms-reservation-payments-table tr {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid var(--cms-border);
        border-radius: 0.5rem;
        background: var(--cms-white);
    }

    .cms-reservation-table td,
    .cms-reservation-resource-table td,
    .cms-reservation-payments-table td {
        padding: 0.55rem 0;
        border-bottom: 1px solid var(--cms-border);
        overflow-wrap: break-word;
        white-space: normal;
    }

    .cms-reservation-table td:last-child,
    .cms-reservation-resource-table td:last-child,
    .cms-reservation-payments-table td:last-child {
        border-bottom: 0;
    }

    .cms-reservation-table td::before,
    .cms-reservation-resource-table td::before,
    .cms-reservation-payments-table td::before {
        display: block;
        margin-bottom: 0.2rem;
        color: var(--cms-muted);
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .cms-reservation-table .cms-button,
    .cms-reservation-payments-table .cms-button {
        width: 100%;
    }
}

/*
 * Unauthenticated CMS shell (login, and the service-unavailable / forbidden
 * / method-not-allowed variants that reuse the same body class): a separate
 * upper-left identity block (.cms-auth-identity) plus a centered card
 * (.cms-auth-shell > .cms-auth-card) -- matching the DAT Consulting
 * reference CMS composition and proportions, not the authenticated
 * workspace's sidebar-offset layout.
 */
/*
 * Matches the reference CMS's own login background exactly: an
 * accent-tinted radial glow (using Marie's dynamic accent-soft,
 * --cms-gold-light, in place of its --cms-accent-soft) over the neutral
 * workspace grey, mostly transparent beyond its 28rem radius. An
 * operator-set background_color/background_image (marie_cms_branding_theme_css(),
 * a later stylesheet) still overrides cleanly: an uploaded image replaces
 * the background-image layer outright, and a plain colour shows through
 * everywhere the gradient has already faded to transparent -- this never
 * touches .cms-shell/.cms-sidebar/.cms-main, so it can only ever affect
 * this login/auth-error background, never the authenticated workspace.
 */
.cms-auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at 15% 10%, var(--cms-gold-light), transparent 28rem), var(--cms-ivory);
}

.cms-auth-identity {
    display: flex;
    position: absolute;
    top: clamp(1.25rem, 3vw, 2.5rem);
    left: clamp(1.25rem, 3vw, 3rem);
    align-items: center;
    gap: 1rem;
}

.cms-auth-identity .cms-brand-mark {
    margin-bottom: 0;
}

/*
 * The uploaded logo here is a wide wordmark, not an icon -- .cms-brand-mark's
 * shared 3rem square footprint (sized for the fallback "M" glyph and reused
 * by the header/sidebar mark) forces it through object-fit:contain into a
 * tiny sliver. Decoupled sizing, scoped to this image in this context only:
 * width follows the image's own aspect ratio up to a wide cap, height caps
 * independently, matching the reference CMS's login logo proportions. The
 * fallback "M" mark (a <span>, never carries -image) and the header/sidebar
 * mark are untouched.
 */
.cms-auth-identity .cms-brand-mark-image {
    flex-shrink: 0;
    width: auto;
    max-width: min(13.75rem, 30vw);
    height: auto;
    max-height: 3.25rem;
}

.cms-auth-identity span {
    display: grid;
    max-width: min(16rem, 45vw);
    min-width: 0;
}

/* Both company and project name are operator-entered text up to 120
   characters -- truncate rather than let a long one overlap the card. */
.cms-auth-identity strong,
.cms-auth-identity small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cms-auth-identity strong {
    font-size: 0.92rem;
}

.cms-auth-identity small {
    color: var(--cms-muted);
    font-size: 0.76rem;
}

/* min-height (not height) so a card taller than the viewport still grows
   the page and scrolls normally instead of clipping. */
.cms-auth-shell {
    display: grid;
    min-height: 100vh;
    padding: 8rem 1.5rem 4rem;
    place-items: center;
}

/* Translucent, not flat white -- the accent-tinted glow behind it (above)
   shows through by design, matching the reference CMS's own login card. */
.cms-auth-card {
    width: min(100%, 32rem);
    padding: 2.35rem 2.35rem 2.8rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-lg);
    box-shadow: var(--cms-shadow-lg);
}

/* Font-family/weight/letter-spacing now come from the global h1 rule --
   this only keeps the login heading's own dedicated size, matching the
   reference CMS's login card (which sizes its h1 separately from its
   generic h1 too, rather than relying on the shared clamp()). */
.cms-auth-card h1 {
    margin-bottom: 0.6rem;
    font-size: 1.9rem;
}

.cms-auth-intro {
    margin-bottom: 1.5rem;
}

@media (max-width: 52rem) {
    /* Identity block returns to normal flow above the card instead of
       overlapping it once there is no longer room to float it in a corner. */
    .cms-auth-identity {
        position: static;
        padding: 1.25rem;
    }

    .cms-auth-identity .cms-brand-mark-image {
        max-height: 2.75rem;
    }

    .cms-auth-shell {
        min-height: auto;
        padding: 1.5rem 1rem 2.5rem;
    }

    .cms-auth-card {
        padding: 1.75rem 1.5rem 2.15rem;
    }
}

.cms-brand-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.5rem;
    place-items: center;
    background: var(--cms-gold-light);
    border: 1px solid rgba(135, 90, 22, 0.35);
    border-radius: 50% 50% 0.4rem 0.4rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
}

.cms-kicker {
    margin-bottom: 0.5rem;
    color: var(--cms-gold-dark);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.cms-auth-intro,
.cms-panel p,
.cms-help {
    color: var(--cms-muted);
}

.cms-form {
    display: grid;
    gap: 0.6rem;
}

.cms-form-grid {
    grid-template-columns: minmax(9rem, 0.45fr) minmax(0, 1fr);
    align-items: center;
}

/*
 * A real, deliberate gap between action buttons, not the incidental single
 * space that plain inline-flex siblings collapse whitespace to -- this was
 * the actual cause of "Filtrovat"/"Zrušit filtry" (and every other Save/
 * Cancel pair sitewide) looking crowded together: .cms-form-actions
 * previously had NO display/gap rule of its own anywhere except two
 * page-scoped copies of this exact declaration (the branding form's own
 * .cms-branding-actions, and .cms-email-template-form .cms-form-actions).
 * Promoted to the base class instead of leaving every other page to
 * accidentally rely on browser whitespace collapse.
 */
.cms-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

label {
    color: #343942;
    font-size: 0.82rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 2.625rem;
    padding: 0.65rem 0.78rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border-strong);
    border-radius: var(--cms-radius-sm);
    font: inherit;
    font-weight: 400;
    transition: border-color 150ms, box-shadow 150ms;
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

input[type="checkbox"] {
    width: 1.25rem;
    min-height: 1.25rem;
}

/*
 * Without this, a file input inherits the generic input{width:100%;
 * min-height:2.625rem;padding:0.65rem 0.78rem} rule above -- stretched
 * across a whole .cms-form-grid field column, a native file input with
 * that much padding renders as a large, mostly-empty bordered rectangle
 * around the small native "Vybrat soubor" control. auto-width plus
 * tighter padding keeps the same native control but sized to its actual
 * content, matching the compact footprint of the buttons beside it.
 */
input[type="file"] {
    width: auto;
    min-height: 0;
    padding: 0.4rem 0.5rem;
    border-color: var(--cms-border);
    background: transparent;
}

.cms-button {
    display: inline-flex;
    min-height: 2.625rem;
    padding: 0.625rem 1rem;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

/*
 * Text stays white in every state (hover/active/focus/focus-visible/
 * visited/disabled), matching the reference CMS's own accent-filled
 * button exactly (admin-polish.css's shared .cms-button/.button/button
 * rule: background/border: var(--cms-accent); color:#fff, reasserted on
 * :hover) -- never dependent on the operator's saved accent colour. This
 * used to be a fixed dark #211b12, chosen for contrast against Marie's own
 * pre-existing default accent (#d4a437, a notably brighter gold than any
 * of the seven real accent presets copied from the reference CMS, which
 * average much darker); with an always-white text colour, that one
 * specific default swatch (never a Gaval-sourced preset, only Marie's own
 * unconfigured fallback) has materially weaker contrast (~2.35:1) than the
 * seven presets do (each ~5:1+, verified against white). Flagged here
 * rather than silently deviating from the requested always-white
 * behaviour -- see the Phase 1 design-system report for the trade-off.
 */
.cms-button-primary {
    color: var(--cms-white);
    background: var(--cms-gold);
    border-color: var(--cms-gold);
}

.cms-button-primary:hover,
.cms-button-primary:focus-visible,
.cms-button-primary:active,
.cms-button-primary:visited {
    color: var(--cms-white);
}

.cms-button-primary:hover {
    background: var(--cms-gold-dark);
    border-color: var(--cms-gold-dark);
}

/*
 * Dark-surface secondary (sidebar sign-out, login/auth card) -- transparent
 * fill, white text, a translucent white border. Never reused on a light
 * .cms-panel background (white-on-white was an existing, real bug there --
 * see .cms-button-light-outline below, now the canonical light-surface
 * secondary/quiet action, generalized off its former .cms-panel scoping so
 * it works consistently wherever it's used, not only inside a panel).
 */
.cms-button-secondary {
    color: var(--cms-white);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
}

.cms-button-light-outline {
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border-color: var(--cms-gold-dark);
}

.cms-button-light-outline:hover {
    color: #211b12;
    background: var(--cms-gold-light);
    border-color: var(--cms-gold-dark);
}

/* Muted, not hidden -- never changes text/background colour to signal
   "disabled", which would risk becoming its own low-contrast bug. */
.cms-button:disabled,
.cms-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.cms-nearby-place-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.cms-button-danger {
    color: var(--cms-error);
    background: var(--cms-white);
    border-color: currentColor;
}

.cms-auth-card .cms-button {
    width: 100%;
    margin-top: 0.75rem;
}

.cms-alert {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-left: 0.25rem solid currentColor;
    border-radius: 0.25rem;
}

.cms-alert-error {
    color: var(--cms-error);
    background: #fae9e7;
}

.cms-alert-success {
    color: var(--cms-success);
    background: #e5f1eb;
}

/*
 * Authenticated shell: a full-height dark sidebar (identity + grouped nav +
 * sign-out) as one grid column, and a plain second column stacking a white
 * toolbar above the light workspace -- the same visual composition as the
 * reference CMS (dark sidebar spanning the full height, a white topbar
 * that visually starts beside it, never covering the identity block), via
 * a plain two-column grid rather than the reference's own negative-margin/
 * z-index overlap between a full-width topbar and the sidebar. Both reach
 * the same result; the grid needs no stacking-context bookkeeping to stay
 * correct as content changes.
 */
.cms-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 17rem minmax(0, 1fr);
}

.cms-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    padding: 1.25rem 1rem;
    flex-direction: column;
    color: var(--cms-white);
    background: var(--cms-charcoal-soft);
}

/*
 * Values match Gaval's own sidebar identity (dat-cms/admin-ui/assets/
 * admin.css's .cms-brand, as finally overridden by sprint10.css's .cms-brand
 * -- see the .cms-brand-frame comment below for the full cascade). Two
 * earlier rounds shrank gap/margin/padding here trying to reclaim width for
 * the company name -- the actual wasted space was the mark wrapper (below),
 * not this frame, so those are restored to Gaval's real values instead of
 * Marie's own smaller guesses.
 */
.cms-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 4.35rem;
    margin: 0 0.25rem 1.35rem;
    padding: 0.3rem;
    color: var(--cms-white);
    text-decoration: none;
}

/*
 * Gaval wraps its mark in its own <span class="cms-brand-mark"> (see
 * dat-cms/admin-ui/layouts/Shell.php), and that wrapper's cascade resolves
 * across three of its stylesheets: admin.css first sizes it as a fixed
 * 2.75rem square; admin-polish.css resizes it to a fixed 52px (3.25rem)
 * square; sprint10.css -- loaded last, so it wins -- turns it into a
 * flexible box (flex: 0 1 auto; width: auto; min-width: 52px; max-width:
 * 88px; height: 52px) that sizes to its own content within that range,
 * instead of a fixed box that reserves more room than the visible logo
 * needs. THAT flexible sizing, not a smaller/narrower box, is what keeps
 * Gaval's logo close to its text: a fixed-width wrapper wider than the
 * image it holds is exactly what created Marie's large gap.
 *
 * Marie's own marie_cms_brand_mark_html() already puts .cms-brand-mark on
 * the image/fallback-glyph itself (reused by the login identity and
 * branding preview, which have no wrapper) -- so this wrapper is named
 * .cms-brand-frame instead of .cms-brand-mark, and sized here in rem
 * (3.25rem / 5.5rem) at the same real pixel values (52px / 88px) as
 * Gaval's own resolved rule.
 */
.cms-brand-frame {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 3.25rem;
    max-width: 5.5rem;
    height: 3.25rem;
    overflow: hidden;
}

/* The fallback "M" glyph now fills .cms-brand-frame's own box instead of a
   separate fixed 2rem square -- background/border/border-radius/font still
   come from the shared .cms-brand-mark default (assets/cms.css, ~line 702). */
.cms-brand-frame .cms-brand-mark {
    width: 100%;
    height: 100%;
    margin: 0;
    color: var(--cms-charcoal);
}

/*
 * A real uploaded logo renders at its own aspect ratio scaled to fit
 * .cms-brand-frame's box (object-fit: contain against that box, not
 * against the source file's own transparent canvas) -- so any transparent
 * padding baked into the uploaded image file is whatever it is, but the
 * *wrapper* never reserves more space than the frame's own bounded box,
 * matching Gaval's .cms-brand-mark img exactly (width/height: auto,
 * max-width/max-height: 100%, object-fit: contain).
 */
.cms-brand-frame .cms-brand-mark-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cms-brand-copy,
.cms-user {
    display: grid;
    min-width: 0;
}

/*
 * Dedicated classes for the two identity lines (matching Gaval's own
 * .cms-brand-copy strong/small), not a bare <strong>/<small> tag selector.
 *
 * Both company and project names are operator-entered text up to 120
 * characters. Gaval keeps its own company name on one line via
 * white-space: nowrap + overflow: visible (sprint10.css), i.e. it accepts
 * letting a too-long name spill past its nominal box rather than wrap or
 * shrink -- not compatible with this project's own requirement that a
 * genuinely long custom name must degrade safely (no clipping, no
 * horizontal scrollbar), so overflow-wrap: break-word is kept here
 * instead: the full name is always readable, never shrinking the logo to
 * compensate, and never forcing a horizontal scrollbar.
 */
.cms-brand-company,
.cms-brand-project {
    overflow-wrap: break-word;
}

/*
 * Gaval's own company name resolves (admin.css's plain .88rem, overridden
 * by sprint10.css's clamp(.78rem, 1vw, .88rem)) to .88rem at any desktop
 * viewport from ~1408px up, .78rem at ~1248px and below, and 1vw of the
 * viewport width in between -- the same formula is used here, with the
 * clamp's max trimmed .88rem -> .82rem: at the real 17rem sidebar, "DAT
 * Consulting CMS" bold at a full .88rem is wider than the space next to
 * even Gaval's own smallest (52px-floor) mark, which Gaval accepts because
 * it lets the text overflow -- the smallest adjustment that keeps this
 * project's own no-overflow requirement is trimming the top of the clamp,
 * not abandoning it for a small fixed size again. font-weight is pinned to
 * a plain 700 rather than left to <strong>'s own UA-default "bolder" (a
 * relative keyword that can resolve heavier, and therefore wider, than a
 * plain 700 depending on the font in use) -- letter-spacing matches
 * Gaval's -.01em too. Genuinely longer custom company names still wrap
 * normally afterwards (overflow-wrap: break-word above).
 *
 * White, not inherited: .cms-brand is an <a>, and the old .cms-sidebar a
 * rule used to set that <a>'s own color to nav-link grey -- narrowing that
 * rule to .cms-nav-group a below (matching Gaval, which never applied its
 * own nav-link rule to .cms-brand in the first place) removes the leak at
 * the source, and this stays explicit besides. Scoped to the real sidebar
 * only -- the branding-page preview (.cms-branding-preview-brand) and the
 * login identity block (.cms-auth-identity) keep their own typography
 * untouched.
 *
 * white-space: nowrap matches Gaval's own company name exactly (Gaval
 * pairs it with overflow: visible, letting an oversized name spill past
 * its box -- real-browser acceptance confirmed the previous
 * overflow-wrap-only approach still wrapped "DAT Consulting CMS" onto two
 * lines despite fitting in isolated width math, so nowrap is what Gaval
 * actually relies on to keep it on one line, not a coincidence of sizing).
 * overflow-wrap: break-word stays alongside it rather than switching to
 * Gaval's own overflow: visible: browsers honour overflow-wrap as a forced
 * break when nowrap would otherwise overflow the line, so it still
 * degrades a genuinely long custom name safely (no clipping, no
 * horizontal scrollbar) without affecting the current, fitting value at
 * all -- nowrap alone governs ordinary-length names like the default.
 */
.cms-brand-company {
    color: var(--cms-white);
    font-size: clamp(0.78rem, 1vw, 0.82rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/*
 * Matches Gaval's own project-name size (sprint10.css: clamp(.67rem,
 * .85vw, .73rem) -- close to, but not quite, Marie's previous flat
 * 0.72rem) and, explicitly, a regular (not bold) weight: nothing in Gaval
 * ever sets font-weight on its project name either, so it renders at the
 * plain inherited 400 -- but in Marie the now-narrowed .cms-nav-group a
 * rule used to leak its own font-weight: 600 onto this element the same
 * way it leaked the company name's grey, since <small> itself carries no
 * weight styling of its own to block that inheritance. Pinned explicitly
 * rather than left to rely on the leak being gone. Color and wrapping are
 * unchanged from before.
 */
.cms-brand-project {
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(0.67rem, 0.85vw, 0.73rem);
    font-weight: 400;
}

.cms-sidebar ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

/*
 * overflow-y:auto (not hidden) keeps every menu item reachable by wheel,
 * trackpad, touch and keyboard scrolling at short viewport heights; the
 * scrollbar itself is hidden (track/thumb only -- the scrolling behaviour
 * is untouched) since a visible white track read as a stray UI element on
 * the dark sidebar. scrollbar-gutter reserves the same space whether or
 * not a scrollbar would have appeared, so nav items don't shift width
 * depending on content length.
 */
.cms-sidebar nav {
    display: grid;
    /* Without this, a flex item's default min-height:auto keeps it at its
       full content height even inside .cms-sidebar's fixed height:100vh --
       nothing would actually shrink to enable this element's own
       overflow-y:auto, and at a short viewport .cms-logout-form (pinned
       below it by margin-top:auto) would be pushed out of view instead of
       staying reachable. This is what makes nav the one scrolling region,
       with the identity above and sign-out below always staying in place. */
    min-height: 0;
    gap: 1.1rem;
    overflow-y: auto;
    scrollbar-width: none;
    scrollbar-gutter: stable;
}

.cms-sidebar nav::-webkit-scrollbar {
    display: none;
}

/* Category grouping, spacing and label styling matching the reference
   CMS's sidebar (.cms-nav-group h2): small-caps, muted against the dark
   sidebar background. A group with no heading (just "Přehled") gets the
   same wrapper for consistent gap rhythm, matching the reference CMS's
   own headerless dashboard group. */
.cms-nav-group {
    display: grid;
    gap: 0.18rem;
}

.cms-nav-group h2 {
    margin: 0 0.72rem 0.2rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/*
 * Scoped to .cms-nav-group a (every real nav link is rendered inside a
 * .cms-nav-group wrapper -- includes/cms.php), matching Gaval's own rule
 * exactly (admin.css's .cms-nav-group a, not a blanket .cms-sidebar a).
 * This used to be a blanket ".cms-sidebar a" selector, which also matches
 * .cms-brand (also an <a> inside .cms-sidebar, but never inside a
 * .cms-nav-group) -- Gaval
 * never had that problem because it scoped this rule to .cms-nav-group a
 * from the start, so .cms-brand was never a nav link as far as this rule
 * was concerned. That blanket match was the root cause of two separate
 * bugs, not just the hover background below: it also set font-weight: 600
 * on the <a class="cms-brand">, which <small class="cms-brand-project">
 * (with no font-weight of its own to block the inheritance) picked up as
 * an unwanted bold project name. No divider between items -- matching the
 * reference CMS, which separates nav links purely with gap (above), never
 * a border.
 */
.cms-nav-group a,
.cms-nav-disabled {
    display: flex;
    min-height: 2.55rem;
    padding: 0.55rem 0.72rem;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.55rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 150ms, color 150ms;
}

.cms-nav-group a:hover {
    color: var(--cms-white);
    background: rgba(255, 255, 255, 0.07);
}

/*
 * Phase 2E-UI: attention count on a nav item ("Platby a doklady"). The same
 * gold pill as the topbar's .cms-notification-count -- informative, not an
 * error red -- but inline: the link is already a space-between flex row, so
 * the pill sits at its right edge without moving the label. "99+" at most.
 */
.cms-nav-count {
    flex: none;
    min-width: 1.25rem;
    margin-left: 0.5rem;
    padding: 0 0.35rem;
    color: #211b12;
    background: var(--cms-gold);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
}

/*
 * Explicit, even though nothing above targets .cms-brand any more -- the
 * brand identity must never show a hover/active background block the way
 * ordinary nav links do, and this documents that as an intentional
 * requirement rather than an accident of scoping that a future change
 * could quietly reintroduce. :focus-visible is left completely alone --
 * the shared global rule (top of this file) still draws its outline on
 * .cms-brand for keyboard focus exactly as it does for every other
 * focusable element.
 */
.cms-brand:hover,
.cms-brand:active {
    background: transparent;
}

.cms-nav-disabled {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.cms-nav-disabled small {
    font-size: 0.65rem;
    white-space: nowrap;
}

.cms-logout-form {
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cms-logout-form .cms-button {
    width: 100%;
}

.cms-workspace {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.cms-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    min-height: 4rem;
    padding: 0.6rem 1.5rem;
    align-items: center;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--cms-border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.cms-user {
    text-align: right;
    text-decoration: none;
}

/* The account name/role block is a real link to "Změnit své heslo" (see
   marie_cms_page_start()) -- readable, keyboard-focusable, and visually
   distinct from the plain body text around it without relying on the
   underline alone, matching the reference CMS's own toolbar identity. */
.cms-user strong {
    display: block;
    color: var(--cms-gold-dark);
    font-size: 0.875rem;
}

.cms-user:hover strong {
    text-decoration: underline;
}

.cms-user small {
    color: var(--cms-muted);
    font-size: 0.75rem;
}

.cms-main {
    width: min(100%, 97.5rem);
    min-width: 0;
    padding: 3rem 2rem;
}

/*
 * display:flex here (not just on the opt-in .cms-heading-actions/
 * .cms-pages-heading modifiers, which most pages never added) is the fix
 * for a confirmed, real bug: any page whose heading carries a trailing
 * action (a "Zpět"/"Přidat" button/link as a second child) had no layout
 * at all on the plain .cms-page-heading div, so the two children stacked
 * vertically -- gallery.php, nearby-places.php, nearby-place-images.php
 * and users.php all had this. Safe for every other page too: a single
 * child in a flex row with space-between/flex-start needs no
 * distribution and renders identically to block flow. flex-wrap so a
 * long kicker/description block plus an action never forces horizontal
 * overflow at narrower desktop widths; align-items: flex-start keeps the
 * action pinned to the first line rather than vertically centering
 * against a multi-line description paragraph.
 */
.cms-page-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    scroll-margin-top: 5rem;
}

.cms-panel {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
}

.cms-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.cms-detail-list div {
    padding: 1rem;
    background: var(--cms-cream);
    border-radius: 0.35rem;
}

/*
 * A small live-preview block (payment instructions, local-fee rate) --
 * previously an undefined class (payments.php, local-fee.php), so it fell
 * back to the browser's own default <blockquote> styling (an indented left
 * margin, no border/background), which read as visually broken/out of
 * place next to every other CMS surface's own cream preview convention
 * (.cms-detail-list div above; .cms-branding-preview-login uses the same
 * idea with its own values). No margin/indent -- a plain bordered block,
 * matching the rest of this app's "preview" surfaces.
 */
.cms-quote {
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--cms-cream);
    border-radius: 0.35rem;
    font-style: normal;
}

/* Místní poplatek "Náhled textu pro hosty": the note that follows the preview
   block stands apart from it (the block itself is unchanged). */
.cms-quote + .cms-help {
    margin-top: 1rem;
}

.cms-detail-list dt {
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.cms-detail-list dd {
    margin: 0.25rem 0 0;
    font-weight: 700;
}

.cms-user-list {
    display: grid;
    gap: 1rem;
}

.cms-stack {
    display: grid;
    gap: 1rem;
}

.cms-section-card,
.cms-menu-item {
    padding: 1rem;
    border: 1px solid var(--cms-border);
    border-radius: 0.5rem;
}

.cms-section-card > h2,
.cms-menu-item > h2 {
    margin-bottom: 1rem;
}

.cms-content-page .cms-main {
    width: min(100%, 72rem);
}

.cms-content-page .cms-button-light-outline,
.cms-pages-page .cms-button-light-outline {
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border-color: var(--cms-gold-dark);
}

.cms-pages-page .cms-main {
    width: min(100%, 72rem);
}

/*
 * accommodation.php's single-resource editor only (Editor ubytování ->
 * Základní informace) -- opt-in, page-scoped classes, exactly like the
 * .cms-content-page/.cms-pages-page precedent immediately above, not a
 * change to the shared .cms-form/.cms-form-grid every other CMS form
 * still uses unmodified. At a wide desktop viewport .cms-main's own
 * 97.5rem cap let every field (short numeric ones especially) stretch to
 * an oversized, prototype-looking width; bounded to a readable content
 * width instead, and its fields grouped by expected value length rather
 * than one flat label|field row per field.
 */
.cms-accommodation-edit-page .cms-main {
    width: min(100%, 56rem);
}

.cms-accommodation-edit-form {
    display: grid;
    grid-template-columns: minmax(9rem, 0.4fr) minmax(0, 1fr);
    gap: 0.6rem 1rem;
    align-items: start;
}

/* Optical alignment against a control's own top padding (input) or first
   line (textarea) -- align-items: start (not center, .cms-form-grid's
   default) reads better once a row's control is taller than one line. */
.cms-accommodation-edit-form > label,
.cms-accommodation-edit-form > span {
    padding-top: 0.65rem;
}

/* Proportionally sized, not the full 1fr field column -- a room/property
   name is realistically a short label (up to 120 characters, but never a
   paragraph), so it gets a width proportional to that instead of
   stretching edge-to-edge. */
.cms-accommodation-edit-name {
    max-width: 24rem;
}

/* Krátký popis: up to 500 characters, realistically 2-3 lines -- shorter
   than the generic textarea{min-height:7rem} default, which left a
   half-empty box for its expected content. */
.cms-accommodation-edit-short-description {
    min-height: 4.5rem;
}

/* Úplný popis: up to 4000 characters -- meaningfully taller than the
   short description instead of sharing its identical generic height. */
.cms-accommodation-edit-full-description {
    min-height: 11rem;
}

/*
 * Základní kapacita / Minimální pobyt / Pořadí: three short numeric
 * fields grouped into one row instead of three full label|field rows
 * each stretching a single-digit-to-three-digit value across the whole
 * field column. Placed in the FIELD column (grid-column: 2), not across
 * both columns, so its left edge lines up exactly with the textareas above
 * (Úplný popis); each input is a compact 7rem instead of a wide 12rem box.
 *
 * align-items: flex-start (not flexbox's own default, stretch) is load-
 * bearing, not cosmetic: the middle field's own help text makes its
 * .cms-accommodation-edit-compact-field box taller than its two
 * siblings. With the default stretch, flexbox forces every field box in
 * the row to that same tallest height -- and because each field box is
 * itself display:grid with implicit auto-sized rows, a container taller
 * than its own content's natural height distributes that leftover space
 * across its auto rows (CSS Grid's own align-content: normal behaves as
 * stretch here), which the <input> in that row then fills via ITS OWN
 * default align-self: stretch. The net effect was two ordinary-looking
 * short number fields rendering as tall as the sentence of help text
 * two fields away. flex-start removes the outer stretch so every field
 * box is exactly as tall as its own content and no taller, and every
 * field's top edge -- so every label -- still lines up on one shared row.
 */
.cms-accommodation-edit-compact-row {
    display: flex;
    grid-column: 2;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.5rem;
}

/* Sized by its label/input; the help text under Minimální pobyt wraps
   within 15rem instead of widening that field. */
.cms-accommodation-edit-compact-field {
    display: grid;
    max-width: 15rem;
    gap: 0.35rem;
}

.cms-accommodation-edit-compact-field label {
    padding-top: 0;
}

/*
 * Defensive, on top of the flex-start fix above: even if a sibling field
 * box becomes taller for some other future reason (e.g. a validation
 * error rendered under just one of these three fields), this input's
 * own row inside its OWN grid never stretches -- align-self: start pins
 * it to its natural control height regardless of how tall its own
 * grid container ends up being.
 */
.cms-accommodation-edit-compact-field input {
    align-self: start;
    width: 7rem;
}

@media (max-width: 40rem) {
    .cms-accommodation-edit-form {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Single-column form: back to its only column (never an implicit
       second one), fields stacked, help text full width. */
    .cms-accommodation-edit-compact-row {
        grid-column: 1;
        flex-direction: column;
    }

    .cms-accommodation-edit-compact-field {
        max-width: none;
        width: 100%;
    }
}

/*
 * accommodation-images.php only (Editor ubytování -> Fotografie) -- opt-in,
 * page-scoped, exactly the same .cms-main-bounding precedent as
 * .cms-accommodation-edit-page above (and .cms-content-page/.cms-pages-page
 * before that). Deliberately does NOT touch the shared
 * .cms-media-list/.cms-media-row/.cms-media-row-content/
 * .cms-media-row-controls/.cms-media-states/.cms-media-row-actions rules
 * themselves (also used by gallery.php) -- an unbounded .cms-main let the
 * upload form's fields and every row's content column stretch far wider
 * than their content needs at a wide desktop viewport, the same problem
 * the Basic Information editor had. A slightly wider bound than the Basic
 * Information editor's 56rem, since this page's rows are a three-column
 * thumbnail/content/controls layout, not a plain label|field form.
 */
.cms-accommodation-images-page .cms-main {
    width: min(100%, 60rem);
}

/*
 * Real vertical-misalignment bug found in browser review, page-scoped fix:
 * the Pořadí control used to be a single <label>Pořadí<input></label>
 * (text and control both inside one inline label, styled only via the
 * shared .cms-media-row-controls > label { max-width: 7rem }) while
 * Alternativní text next to it is two separate sibling elements (a
 * <label for> then its own <input>) inside .cms-media-row-content's own
 * grid -- two different DOM shapes stacked in two independent
 * single-column grids, so their "row 2" (the actual input) never lined
 * up: Alternativní text's input sits below its own label row, but
 * Pořadí's input sat inside the SAME row as its label text, one row
 * higher. Restructuring marie-admin/accommodation-images.php's markup to
 * the identical sibling label/input shape (see the template) is the real
 * fix -- both .cms-media-row-content and .cms-media-row-controls are then
 * two parallel single-column grids whose row 1 (a plain <label>) and row 2
 * (a plain <input>) are the same height in both columns (same shared
 * label/input typography), so they align by construction, not by a
 * magic-number offset. This replaces the width constraint that used to
 * live on the wrapping <label> (removed by the markup change) --
 * page-scoped, not a change to the shared, unscoped rule gallery.php and
 * nearby-place-images.php still rely on for their own (untouched) Pořadí
 * markup.
 */
.cms-accommodation-images-page .cms-accommodation-order-input {
    max-width: 7rem;
}

/*
 * Real overlapping-row bug found in browser review, page-scoped fix: the
 * shared .cms-delete-confirmation-panel (gallery.php's own convention,
 * reused as-is) is position: absolute, which was never in normal document
 * flow -- opening it visually floated the panel on top of the *next*
 * photograph row instead of pushing it down. Overridden here to
 * participate in normal flow instead (no absolute positioning, no
 * negative margins): the <details> element that contains it is one of
 * three flex items in .cms-media-row-actions, so once it holds normal-flow
 * content taller than a single line, .cms-media-row-actions grows with it,
 * .cms-media-row-controls (a plain single-column grid, align-items: start
 * at the outer .cms-media-row level) grows with that, and the whole
 * .cms-media-row article -- sized by its tallest column, not stretched --
 * grows too, pushing the next .cms-media-row sibling down through .cms-
 * media-list's own row gap exactly like any other taller row would.
 * Page-scoped rather than changing the shared rule itself: this
 * environment cannot browser-verify the effect on gallery.php, which the
 * unmodified shared rule continues to serve exactly as before.
 */
.cms-accommodation-images-page .cms-delete-confirmation-panel {
    position: static;
    z-index: auto;
    right: auto;
    width: auto;
    max-width: 100%;
    margin-top: .5rem;
}

/*
 * accommodation.php's amenities editor (marie-admin/amenities.php, route
 * cms.amenities) only -- opt-in, page-scoped, the same .cms-main-bounding
 * precedent as .cms-accommodation-edit-page/.cms-accommodation-images-page
 * above. This page used to render all five catalogue resources' checkbox
 * sections (and submit all five in one POST) regardless of which one was
 * selected -- now scoped server-side to exactly one resource per request,
 * same as the other accommodation sub-pages; this bound just keeps its
 * (now much shorter) content from stretching edge-to-edge at a wide
 * desktop viewport.
 */
.cms-accommodation-amenities-page .cms-main {
    width: min(100%, 60rem);
}

/*
 * The shared .cms-checkbox-grid (assets/cms.css, used here and by
 * amenities.php only) already reflows to 2-3 columns at desktop widths and
 * collapses to one column at <=800px -- unchanged. Only each individual
 * <label>'s own internal layout is page-scoped here: a plain <label>
 * wrapping a checkbox then text is inline by default, so a label long
 * enough to wrap onto a second line left its checkbox sitting at the very
 * top instead of centered against the label's own (possibly multi-line)
 * text. flex + a deliberate gap keeps the checkbox aligned beside the
 * text without touching the shared, unscoped label rule other checkbox
 * lists (e.g. Zveřejnění/Hlavní menu check-rows) rely on unmodified.
 */
.cms-accommodation-amenities-page .cms-checkbox-grid label {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/*
 * E-maily settings page: SMTP settings and the test-email form are native
 * <details>, collapsed by default (see marie-admin/email.php). Only light
 * affordance/spacing styling -- the disclosure behaviour itself is native
 * and needs no JavaScript. The shared :focus-visible rule already covers
 * keyboard focus on <summary> (it is a native interactive element).
 */
.cms-email-page details.cms-panel > summary {
    cursor: pointer;
}

.cms-email-page details.cms-panel > summary > h2 {
    display: inline-block;
    margin-bottom: 0;
}

.cms-email-page details.cms-panel[open] > summary {
    margin-bottom: 1rem;
}

/*
 * Outgoing-email queue (marie-admin/email-outbox.php), its own page. The
 * table uses NATURAL (auto) sizing and is deliberately allowed to exceed the
 * panel width -- .cms-table-wrap (overflow-x: auto) confines any resulting
 * overflow to a scrollbar on the table itself, never the page. This is the
 * opposite of forcing every column into the viewport: cramming an 11-column
 * table into a narrow width with overflow-wrap:anywhere is what previously
 * broke ordinary Czech words (and the longest message-type label) into
 * unreadable 2-4 character fragments -- removed here.
 *
 * Only three columns (message type, template, subject) get an explicit
 * minimum width and are left at the browser default word-wrap (break only at
 * spaces, never inside a word) so their longest realistic labels stay
 * readable on a few lines instead of one extremely long one. A handful of
 * naturally short, compact columns (queued/sent timestamps, the reservation
 * reference, the masked recipient, status, attempt count) are kept to a
 * single line with white-space: nowrap so they never wrap oddly. Every other
 * column (notably "Poslední chyba / důvod", which can carry a long Czech
 * label or a raw fallback category/identifier) is left at the plain browser
 * default: normal word-wrap, no forced nowrap, no forced breaking -- an
 * unbroken raw identifier simply stays whole and widens the table/scrollbar
 * instead of being fragmented.
 */
.cms-email-outbox-table {
    width: auto;
    min-width: 100%;
}

.cms-email-outbox-table .cms-email-col-compact {
    white-space: nowrap;
}

.cms-email-outbox-table .cms-email-col-type {
    min-width: 12rem;
}

.cms-email-outbox-table .cms-email-col-template {
    min-width: 14rem;
}

.cms-email-outbox-table .cms-email-col-subject {
    min-width: 18rem;
}

/* .cms-pages-heading no longer needs its own rule -- its flex layout is
   now the .cms-page-heading base (below/above); pages.php still carries
   both classes on the same element, harmlessly. */

.cms-pages-list {
    display: grid;
    min-width: 0;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    overflow: visible;
}

.cms-homepage-section-card.cms-page-list-card {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
}

.cms-page-list-content {
    min-width: 0;
}

/*
 * break-word, not anywhere: a page title/excerpt is prose with ordinary
 * spaces to break at, so anywhere's arbitrary mid-word fragmentation
 * (the anti-pattern already fixed for the reservation tables) isn't
 * needed here -- unlike .cms-page-list-url just below, which genuinely
 * can be one long unbroken token (a slug-based URL) and keeps anywhere.
 */
.cms-page-list-content h2,
.cms-page-list-content p {
    margin-bottom: 0.4rem;
    overflow-wrap: break-word;
}

.cms-page-list-excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--cms-muted);
    font-size: 0.9rem;
}

.cms-page-list-url {
    color: var(--cms-muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.cms-page-list-url span {
    font-weight: 700;
}

.cms-page-list-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.cms-status.is-menu {
    color: #5b3c08;
    background: var(--cms-gold-light);
}

.cms-status.is-noindex {
    color: #4b5563;
    background: #e8edf3;
}

.cms-page-list-actions {
    align-self: center;
}

.cms-pages-empty-state {
    display: grid;
    justify-items: start;
}

/* pages.php permanent deletion (dialog + no-JS confirmation panel). */
.cms-page-delete-panel {
    border-color: var(--cms-error);
}

.cms-page-delete-dialog h2,
.cms-page-delete-panel h2 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.cms-page-delete-dialog .cms-form,
.cms-page-delete-panel .cms-form {
    gap: 1rem;
}

.cms-page-delete-warning {
    margin: 0 0 1rem;
    color: var(--cms-charcoal);
}

.cms-page-delete-blockers {
    margin: 0.5rem 0 1rem;
    padding-left: 1.2rem;
}

/*
 * page.php only: the save/back row is a plain left-aligned row at the very
 * bottom of the editor, after the photo-upload card (no card, no sticky).
 * The 1.5rem (24px) top margin collapses with the card's 1rem bottom margin;
 * wrapping on narrow screens comes from the shared .cms-form-actions rule,
 * which is unchanged.
 */
.cms-page-editor-actions {
    margin-top: 1.5rem;
}

.cms-footer-preview {
    padding: 1rem;
    color: var(--cms-white);
    background: var(--cms-charcoal);
    border-radius: var(--cms-radius);
}

.cms-footer-preview p {
    margin: 0.35rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 400;
}

@media (max-width: 52rem) {
    .cms-homepage-section-card.cms-page-list-card {
        grid-template-columns: 1fr;
    }

    .cms-page-list-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 36rem) {
    .cms-pages-heading,
    .cms-page-list-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cms-pages-heading .cms-button,
    .cms-page-list-actions .cms-button {
        width: 100%;
    }
}

.cms-homepage-sections {
    display: grid;
    gap: 0.75rem;
}

.cms-homepage-section-card {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr) auto;
    gap: 1rem;
    min-width: 0;
    padding: 0.85rem;
    align-items: center;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius);
    box-shadow: 0 0.35rem 1rem rgba(45, 36, 24, 0.05);
}

.cms-homepage-section-card.is-dragging {
    opacity: 0.55;
}

.cms-homepage-section-card.is-drag-ready {
    cursor: grab;
}

.cms-section-preview {
    display: grid;
    width: 6rem;
    height: 4.5rem;
    overflow: hidden;
    place-items: center;
    color: var(--cms-gold-dark);
    background: var(--cms-cream);
    border: 1px solid var(--cms-border);
    border-radius: 0.5rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
}

.cms-section-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cms-section-summary {
    min-width: 0;
}

.cms-section-summary-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
}

.cms-section-summary h2,
.cms-section-summary p {
    margin-bottom: 0.25rem;
}

.cms-section-summary p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--cms-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.cms-section-summary p strong {
    color: var(--cms-charcoal);
    font-weight: 600;
}

.cms-section-card-actions,
.cms-order-controls,
.cms-content-order-actions,
.cms-section-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.cms-section-card-actions {
    justify-content: flex-end;
}

.cms-order-button {
    width: 2.5rem;
    min-height: 2.5rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 0.35rem;
    cursor: pointer;
}

.cms-order-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.cms-content-order-actions {
    position: sticky;
    bottom: 0;
    padding-block: 0.75rem;
    justify-content: flex-end;
    background: var(--cms-ivory);
}

.cms-section-editor-layout {
    display: grid;
    grid-template-columns: minmax(13rem, 0.32fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.cms-section-editor-preview {
    position: sticky;
    top: 6rem;
}

.cms-section-preview-large {
    width: 100%;
    height: 9rem;
    margin-bottom: 1rem;
}

.cms-section-editor-form {
    width: 100%;
    min-width: 0;
}

.cms-section-editor-form .cms-help {
    grid-column: auto;
    margin: 0.35rem 0 0;
}

.cms-section-editor-actions {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

@media (max-width: 52rem) {
    .cms-homepage-section-card {
        grid-template-columns: 5rem minmax(0, 1fr);
    }

    .cms-section-preview {
        width: 5rem;
        height: 3.75rem;
    }

    .cms-section-card-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .cms-section-editor-layout {
        grid-template-columns: 1fr;
    }

    .cms-section-editor-preview {
        position: static;
    }
}

@media (max-width: 36rem) {
    .cms-homepage-section-card {
        grid-template-columns: 1fr;
    }

    .cms-section-preview {
        width: 100%;
        height: 6rem;
    }

    /* The section editor's Uložit / Zrušit / Zpět row is deliberately not
       stacked here: it stays one row and simply wraps (base rule above). */
    .cms-section-card-actions,
    .cms-content-order-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cms-section-card-actions .cms-button,
    .cms-content-order-actions .cms-button {
        width: 100%;
    }

    .cms-order-controls {
        justify-content: center;
    }
}

.cms-check-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.cms-check-row label {
    margin: 0;
}

.cms-form-wide {
    grid-column: 1 / -1;
}

.cms-user-card {
    padding: 1rem;
    border: 1px solid var(--cms-border);
    border-radius: 0.5rem;
}

.cms-user-card-heading {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: space-between;
}

.cms-user-card-heading div {
    display: grid;
}

.cms-user-card-heading small,
.cms-help {
    font-size: 0.75rem;
}

.cms-status.is-active {
    color: var(--cms-success);
    background: #e5f1eb;
}

.cms-status.is-inactive {
    color: var(--cms-error);
    background: #fae9e7;
}

/*
 * Requires a .cms-form-grid ancestor (:where() so this contributes zero
 * specificity of its own -- every existing override below/elsewhere keeps
 * exactly the same effective specificity it always had) -- previously a
 * bare ".cms-help, .cms-form-actions" applied this everywhere, including
 * inside plain single-column grids like .cms-stack/.cms-asset-section,
 * which forces the browser to invent a narrow implicit second column and
 * exile that content into it. That was the actual root cause of a308ef3's
 * branding-page regression (huge blank areas, scattered fields, actions
 * overlapping content); branding.php's own .cms-branding-* classes exist
 * specifically to avoid these two shared classes rather than fight this
 * rule. Scoping it to .cms-form-grid removes the landmine at the source
 * instead of requiring every future non-form-grid page to carve out its
 * own exception the way .cms-email-template-form and
 * .cms-reservation-filters below still do (now redundant, but harmless).
 */
:where(.cms-form-grid) .cms-help,
:where(.cms-form-grid) .cms-form-actions {
    grid-column: 2;
}

/* SEO "Náhled výsledku vyhledávání" (marie-admin/seo.php): sits in the input
   column like the help texts, so its edges match the Google title/description
   fields; one column on phones (below). */
:where(.cms-form-grid) .cms-seo-preview {
    grid-column: 2;
}

.cms-seo-preview {
    min-width: 0;
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.cms-heic-status:empty {
    display: none;
}

.cms-heic-status[data-state="converting"] {
    color: var(--cms-gold-dark);
}

.cms-heic-status[data-state="error"] {
    color: var(--cms-error);
    font-weight: 700;
}

/*
 * Mobile/tablet (<= 52rem) off-canvas sidebar. Below this width the
 * persistent 17rem column would leave too little workspace, and stacking it
 * above the workspace (the previous approach) made every page start with a
 * full screen of navigation. The sidebar is instead a fixed drawer below the
 * sticky topbar, hidden by default (visibility:hidden also removes it from
 * the tab order and the accessibility tree), opened by .cms-menu-toggle via
 * assets/cms.js (html.cms-nav-open). Without JavaScript, assets/cms-no-js.css
 * (loaded inside <noscript>) restores an always-visible stacked nav placed
 * after the page content. Desktop rules above are untouched.
 */
.cms-menu-toggle,
.cms-sidebar-backdrop {
    display: none;
}

@media (max-width: 52rem) {
    html {
        /* Reserves the scrollbar's space even while the open menu locks
           scrolling, so a classic-scrollbar browser never shifts the page. */
        scrollbar-gutter: stable;
    }

    html.cms-nav-open,
    html.cms-nav-open body {
        overflow: hidden;
    }

    .cms-shell {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    /* A fixed height (not min-height) so the drawer and backdrop can start
       exactly at its bottom edge; the account lines truncate instead of
       wrapping the bar taller. */
    .cms-topbar {
        height: 4rem;
        min-height: 0;
        padding-inline: 0.75rem 1rem;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .cms-topbar-end {
        min-width: 0;
        gap: 0.75rem;
    }

    .cms-user {
        max-width: 11rem;
    }

    .cms-user strong,
    .cms-user small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cms-menu-toggle {
        display: inline-flex;
        flex: none;
        min-height: 2.5rem;
        padding: 0 0.8rem 0 0.65rem;
        align-items: center;
        gap: 0.45rem;
        color: var(--cms-charcoal);
        background: var(--cms-white);
        border: 1px solid var(--cms-border-strong);
        border-radius: 0.5rem;
        font: inherit;
        font-size: 0.875rem;
        font-weight: 700;
        cursor: pointer;
    }

    .cms-menu-toggle:hover {
        border-color: var(--cms-gold-dark);
    }

    .cms-menu-toggle:focus-visible {
        outline: 2px solid var(--cms-focus);
        outline-offset: 2px;
    }

    .cms-menu-toggle[aria-expanded="true"] {
        color: #211b12;
        background: var(--cms-gold-light);
        border-color: var(--cms-gold-dark);
    }

    .cms-menu-toggle-close,
    .cms-menu-toggle[aria-expanded="true"] .cms-menu-toggle-open {
        display: none;
    }

    .cms-menu-toggle[aria-expanded="true"] .cms-menu-toggle-close {
        display: inline;
    }

    /* Below the topbar (z-index 10), so the toggle -- now the close
       control -- and the account/bell stay visible and usable. */
    .cms-sidebar {
        position: fixed;
        top: 4rem;
        bottom: 0;
        left: 0;
        z-index: 30;
        width: min(18rem, 86vw);
        height: auto;
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 200ms ease, visibility 0s linear 200ms;
        box-shadow: none;
    }

    html.cms-nav-open .cms-sidebar {
        visibility: visible;
        transform: none;
        transition: transform 200ms ease;
        box-shadow: var(--cms-shadow-lg);
    }

    .cms-sidebar nav {
        overscroll-behavior: contain;
    }

    html.cms-nav-open .cms-sidebar-backdrop {
        position: fixed;
        top: 4rem;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 25;
        display: block;
        background: rgba(16, 24, 40, 0.45);
    }
}

@media (max-width: 52rem) and (prefers-reduced-motion: reduce) {
    .cms-sidebar,
    html.cms-nav-open .cms-sidebar {
        transition: none;
    }
}

@media (max-width: 36rem) {
    .cms-user {
        max-width: 9rem;
    }

    .cms-detail-list,
    .cms-form-grid {
        grid-template-columns: 1fr;
    }

    .cms-help,
    .cms-form-actions,
    .cms-seo-preview {
        grid-column: 1;
    }

    .cms-main {
        padding-inline: 0.75rem;
    }
}

.cms-heading-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.cms-button-light {
    color: var(--cms-charcoal);
    border: 1px solid var(--cms-gold);
    background: var(--cms-white);
}

.cms-button-light:hover {
    color: var(--cms-charcoal);
    background: var(--cms-cream);
}

.cms-button-light:focus-visible {
    outline: 3px solid var(--cms-gold);
    outline-offset: 2px;
}

.cms-button-small {
    min-height: 2.75rem;
    padding: 0.5rem 0.7rem;
}

/*
 * Rezervace -> Kalendář dostupnosti (marie-admin/availability.php) only:
 * every rule is scoped to the page's body class. One month, full card
 * width, seven equal columns. The day colours are the PUBLIC calendar's
 * own values (assets/style.css --color-availability-available-bg/-fg,
 * --color-availability-unavailable-bg/-fg, .public-availability-day.is-unknown,
 * the gold today border), redeclared here because the CMS does not load
 * style.css. Ruční blokace (amber) and Provozní uzavření (muted red) are
 * CMS-only states derived from the page's active blocks.
 */
.cms-availability-page {
    --cms-cal-available-bg: #e3f3e7;
    --cms-cal-available-fg: #245d3d;
    --cms-cal-unavailable-bg: #f8e1df;
    --cms-cal-unavailable-fg: #8a3b34;
    --cms-cal-blocked-bg: #fdebc8;
    --cms-cal-blocked-fg: #7a4a00;
    --cms-cal-closure-bg: #efc9c4;
    --cms-cal-closure-fg: #6e1f1a;
    --cms-cal-unknown-bg: #eeeae3;
    --cms-cal-unknown-fg: #5f5950;
    --cms-cal-today: #d4a437;
    --cms-cal-today-inner: #f3e3b6;
}

/*
 * Layout follows the PUBLIC calendar (assets/style.css .availability-grid,
 * .public-availability-day, .availability-legend): a compact month of
 * nearly square cells -- seven minmax(0, 1fr) columns, 0.2rem gap,
 * 0.25rem radius, the day number with one small line under it -- centred
 * in the card, the month heading centred above it and the legend centred
 * below. The public month is ~24rem wide (3.3rem cells); the CMS month is
 * capped at 28rem (~3.8rem cells) so the short state label still fits.
 */
.cms-availability-page {
    --cms-cal-width: 28rem;
}

/* Selector row, then the month navigation at the calendar's own width. */
.cms-availability-page .cms-calendar-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cms-availability-page .cms-calendar-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    justify-content: center;
}

.cms-availability-page .cms-calendar-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.cms-availability-page .cms-calendar-field select {
    width: auto;
    min-width: 11rem;
    max-width: 16rem;
    min-height: 2.625rem;
}

.cms-availability-page .cms-calendar-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    width: 100%;
    max-width: var(--cms-cal-width);
    align-items: center;
    text-align: center;
}

.cms-availability-page .cms-calendar-heading h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.cms-availability-page .cms-calendar-heading h2::first-letter {
    text-transform: uppercase;
}

.cms-availability-page .cms-calendar-heading .cms-button {
    gap: 0.3rem;
}

/* Legend below the calendar, centred like the public one. */
.cms-availability-page .cms-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    max-width: 40rem;
    margin: 1rem auto 0;
    padding: 0;
    justify-content: center;
    list-style: none;
    color: #343942;
    font-size: 0.8125rem;
}

.cms-availability-page .cms-calendar-legend li {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.cms-availability-page .cms-calendar-swatch {
    display: inline-grid;
    width: 1.5rem;
    height: 1.5rem;
    place-items: center;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 900;
}

/* The month: compact, nearly square cells, centred in the card. */
.cms-availability-page .cms-calendar-component {
    width: 100%;
}

.cms-availability-page .cms-calendar-scroll {
    overflow-x: auto;
}

.cms-availability-page .cms-availability-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.2rem;
    width: 100%;
    max-width: var(--cms-cal-width);
    min-width: 0;
    margin-inline: auto;
}

.cms-availability-page .cms-availability-calendar .availability-weekday {
    min-width: 0;
    padding-block: 0.25rem 0.4rem;
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.cms-availability-page .cms-availability-calendar .availability-day-empty {
    aspect-ratio: 1;
    min-width: 0;
    border: 0;
    background: transparent;
}

.cms-availability-page .cms-availability-day {
    display: flex;
    flex-direction: column;
    aspect-ratio: 1;
    min-width: 0;
    min-height: 2.9rem;
    padding: 0.2rem 0.1rem;
    gap: 0.2rem;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    background: var(--cms-white);
    line-height: 1;
}

.cms-availability-page .cms-availability-day time {
    font-size: 0.95rem;
    font-weight: 700;
}

.cms-availability-page .cms-availability-status {
    display: flex;
    max-width: 100%;
    min-width: 0;
    gap: 0.15rem;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.05;
}

.cms-availability-page .cms-availability-marker {
    flex: 0 0 auto;
    font-weight: 900;
}

.cms-availability-page .cms-availability-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cms-availability-page .cms-availability-day.is-available,
.cms-availability-page .cms-calendar-swatch.is-available {
    color: var(--cms-cal-available-fg);
    background: var(--cms-cal-available-bg);
}

.cms-availability-page .cms-availability-day.is-unavailable,
.cms-availability-page .cms-calendar-swatch.is-unavailable {
    color: var(--cms-cal-unavailable-fg);
    background: var(--cms-cal-unavailable-bg);
}

.cms-availability-page .cms-availability-day.is-blocked,
.cms-availability-page .cms-calendar-swatch.is-blocked {
    color: var(--cms-cal-blocked-fg);
    background: var(--cms-cal-blocked-bg);
}

.cms-availability-page .cms-availability-day.is-closure,
.cms-availability-page .cms-calendar-swatch.is-closure {
    color: var(--cms-cal-closure-fg);
    background: var(--cms-cal-closure-bg);
}

.cms-availability-page .cms-availability-day.is-unknown,
.cms-availability-page .cms-calendar-swatch.is-unknown {
    color: var(--cms-cal-unknown-fg);
    background: var(--cms-cal-unknown-bg);
}

/* Weekends: a faint shade over any state, never a different colour. */
.cms-availability-page .cms-availability-day.is-weekend {
    background-image: linear-gradient(rgba(78, 73, 66, 0.045), rgba(78, 73, 66, 0.045));
}

/* Provozní uzavření: a faint hatch keeps it distinct from ordinary Obsazeno
   at a glance (after the weekend rule, so weekends keep it too). */
.cms-availability-page .cms-availability-day.is-closure,
.cms-availability-page .cms-calendar-swatch.is-closure {
    background-image: repeating-linear-gradient(135deg, rgba(110, 31, 26, 0.09) 0 4px, transparent 4px 9px);
}

.cms-availability-page .cms-availability-day.is-today {
    border-color: var(--cms-cal-today);
    box-shadow: inset 0 0 0 1px var(--cms-cal-today-inner);
}

.cms-availability-page .cms-calendar-note {
    max-width: 40rem;
    margin: 0.6rem auto 0;
    text-align: center;
}

/* Ruční blokace table: DAT CMS table, semantic badges, quiet Upravit. */
.cms-availability-page .cms-block-category.is-blocked {
    color: var(--cms-cal-blocked-fg);
    background: var(--cms-cal-blocked-bg);
}

.cms-availability-page .cms-block-category.is-closure {
    color: var(--cms-cal-closure-fg);
    background: var(--cms-cal-closure-bg);
}

.cms-availability-page .cms-block-table .cms-status.is-inactive {
    color: #334155;
    background: #e8edf3;
}

.cms-availability-page .cms-block-table td small,
.cms-availability-page .cms-block-table .cms-block-note {
    color: var(--cms-muted);
    font-size: 0.8125rem;
}

.cms-availability-page .cms-block-table .cms-block-edit-link {
    min-height: 2.4rem;
    padding: 0.45rem 0.85rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border-strong);
    white-space: nowrap;
}

.cms-availability-page .cms-block-table .cms-block-edit-link:hover {
    background: var(--cms-ivory);
    border-color: var(--cms-gold-dark);
}

.cms-availability-page .cms-block-table .cms-block-edit-link:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
}

/* Phone: block records become labelled cards (Bankovní pohyby pattern). */
@media (max-width: 52rem) {
    .cms-availability-page .cms-block-table,
    .cms-availability-page .cms-block-table tbody,
    .cms-availability-page .cms-block-table tr,
    .cms-availability-page .cms-block-table td {
        display: block;
        width: 100%;
    }

    .cms-availability-page .cms-block-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .cms-availability-page .cms-block-table tr {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid var(--cms-border);
        border-radius: 0.5rem;
        background: var(--cms-white);
    }

    .cms-availability-page .cms-block-table td {
        padding: 0.55rem 0;
        border-bottom: 1px solid var(--cms-border);
        overflow-wrap: break-word;
        white-space: normal;
    }

    .cms-availability-page .cms-block-table td:last-child {
        border-bottom: 0;
    }

    .cms-availability-page .cms-block-table td::before {
        display: block;
        margin-bottom: 0.2rem;
        color: var(--cms-muted);
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .cms-availability-page .cms-block-table .cms-block-edit-link {
        width: 100%;
        min-height: 2.75rem;
    }

    .cms-availability-page .cms-calendar-toolbar {
        align-items: stretch;
    }

    .cms-availability-page .cms-calendar-heading {
        margin-inline: auto;
    }
}

@media (max-width: 40rem) {
    .cms-heading-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cms-availability-page .cms-calendar-filter,
    .cms-availability-page .cms-calendar-field {
        width: 100%;
    }

    .cms-availability-page .cms-calendar-field select {
        width: 100%;
        max-width: none;
    }

    .cms-availability-page .cms-calendar-heading .cms-button {
        min-width: 2.75rem;
        padding: 0;
    }

    .cms-availability-page .cms-calendar-nav-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* Narrow phones (the month no longer reaches 28rem): number + marker only,
   like the public calendar; the full state stays in each aria-label. */
@media (max-width: 34rem) {
    .cms-availability-page .cms-availability-status-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .cms-availability-page .cms-availability-calendar {
        gap: 0.1rem;
    }

    .cms-availability-page .cms-availability-calendar .availability-weekday {
        font-size: 0.68rem;
    }

    .cms-availability-page .cms-availability-day {
        min-height: 2.5rem;
        padding: 0.15rem;
    }

    .cms-availability-page .cms-availability-day time {
        font-size: 0.85rem;
    }
}

.page-editor {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    width: 100%;
    min-width: 0;
    gap: .65rem;
    align-items: stretch;
}

.page-editor > * {
    grid-column: 1;
    min-width: 0;
}

.page-editor-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .5rem;
    background: var(--cms-cream);
    border: 1px solid var(--cms-border);
    border-radius: .5rem .5rem 0 0;
    width: 100%;
}

.page-editor-toolbar button {
    display: inline-grid;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: .35rem;
    color: inherit;
    cursor: pointer;
    padding: 0;
    place-items: center;
    font-size: 1.05rem;
}

.page-editor-toolbar button:hover,
.page-editor-toolbar button[aria-pressed="true"] {
    border-color: var(--cms-gold-dark);
    background: #f4ead7;
    color: var(--cms-gold-dark);
}

.page-editor-toolbar button[data-editor-command="justifyLeft"] span {
    text-align: left;
}

.page-editor-toolbar button[data-editor-command="justifyCenter"] span {
    text-align: center;
}

.page-editor-toolbar button[data-editor-command="justifyRight"] span {
    text-align: right;
}

.page-editor-toolbar button[data-editor-command^="justify"] span {
    width: 1.1rem;
}

.page-editor-format {
    display: flex;
    min-width: 10rem;
    gap: .4rem;
    align-items: center;
}

.page-editor-spacing {
    display: flex;
    min-width: 7rem;
    gap: .35rem;
    align-items: center;
}

.page-editor-spacing select {
    min-height: 2.5rem;
    padding-block: .35rem;
}

.page-editor-size {
    display: flex;
    width: 5rem;
    align-items: center;
}

.page-editor-size select {
    min-height: 2.5rem;
    padding-block: .35rem;
}

.page-editor-colors {
    position: relative;
}

.page-editor-colors > summary {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--cms-border);
    border-radius: .35rem;
    background: var(--cms-white);
    cursor: pointer;
    list-style: none;
    place-items: center;
    font-weight: 800;
}

.page-editor-colors > summary::-webkit-details-marker {
    display: none;
}

.page-editor-color-palette {
    display: grid;
    position: absolute;
    z-index: 5;
    top: calc(100% + .35rem);
    left: 0;
    width: 11.5rem;
    grid-template-columns: repeat(4, 2.5rem);
    gap: .35rem;
    padding: .65rem;
    border: 1px solid var(--cms-border);
    border-radius: .5rem;
    background: var(--cms-white);
    box-shadow: var(--cms-shadow);
}

.page-editor-color-swatch {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid rgba(37, 34, 30, .35);
    border-radius: .2rem;
}

.page-editor-color-default { background: linear-gradient(135deg, #fff 44%, #e00000 45%, #e00000 55%, #25221e 56%); }
.page-editor-color-charcoal { background: #24211d; }
.page-editor-color-gray { background: #667085; }
.page-editor-color-red { background: #e00000; }
.page-editor-color-orange { background: #e85d04; }
.page-editor-color-gold { background: #9a6700; }
.page-editor-color-green { background: #16803a; }
.page-editor-color-teal { background: #07847e; }
.page-editor-color-blue { background: #175cd3; }
.page-editor-color-navy { background: #3448a1; }
.page-editor-color-purple { background: #7a3e9d; }
.page-editor-color-pink { background: #c11574; }
.page-editor-color-brown { background: #795548; }

.page-editor-format select {
    min-height: 2.5rem;
    padding-block: .35rem;
}

.page-editor-surface {
    width: 100%;
    min-width: 0;
    min-height: 30rem;
    overflow-wrap: anywhere;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-top: 0;
    border-radius: 0 0 .5rem .5rem;
    box-shadow: inset 0 1px 2px rgba(45, 36, 24, .04);
    line-height: 1.7;
    overflow-x: auto;
}

.page-editor-surface h2,
.page-editor-surface h3 {
    margin-block: 1.25em .5em;
}

.page-editor-surface ol {
    padding-left: 2rem;
    list-style: decimal outside;
}

.page-editor-surface ul {
    padding-left: 2rem;
    list-style: disc outside;
}

.page-editor-surface p[data-page-spacer] {
    min-height: 1em;
    margin-block: 0;
}

.page-editor-table {
    width: 100%;
    min-width: 32rem;
    margin-block: 1rem;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.page-editor-table th,
.page-editor-table td {
    box-sizing: border-box;
    position: relative;
    min-width: 5rem;
    padding: .25rem .6rem;
    vertical-align: top;
    line-height: 1.35;
}

.page-editor-table th[height],
.page-editor-table td[height] {
    padding-block: 0;
    line-height: 1.1;
}

.page-table-resize-handle {
    position: absolute;
    z-index: 2;
    top: 0;
    right: -.35rem;
    width: .7rem;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

.page-table-resize-handle::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 1px);
    border-left: 2px solid rgba(111, 87, 50, .55);
}

.page-table-resize-handle:focus-visible {
    outline: 3px solid var(--cms-focus);
    outline-offset: 1px;
}

.page-table-row-resize-handle {
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: -.3rem;
    left: 0;
    height: .6rem;
    cursor: row-resize;
    touch-action: none;
}

.page-table-row-resize-handle::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: calc(50% - 1px);
    left: 0;
    border-bottom: 2px solid rgba(111, 87, 50, .4);
}

.page-table-row-resize-handle:focus-visible {
    outline: 3px solid var(--cms-focus);
    outline-offset: 1px;
}

.page-table-context {
    display: flex;
    grid-column: 1;
    width: 100%;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    padding: .65rem;
    border: 1px solid var(--cms-border);
    background: var(--cms-cream);
}

.page-table-context[hidden] {
    display: none;
}

.page-table-context-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.page-table-context button {
    min-height: 2.5rem;
    padding: .4rem .65rem;
}

.page-table-context label {
    display: flex;
    max-width: 13rem;
    gap: .35rem;
    align-items: center;
}

.page-table-context input {
    width: 6rem;
}

.page-editor-table .page-table-column-selected {
    background-color: rgba(195, 151, 77, .08);
}

.page-editor-table .page-table-row-selected {
    box-shadow: inset 0 0 0 2px rgba(155, 111, 42, .3);
}

.page-editor-table .page-table-cell-selected {
    box-shadow: inset 0 0 0 3px var(--cms-focus);
}

.page-table-width-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: .6rem;
    padding: .75rem;
    border: 1px solid var(--cms-border);
}

.page-table-width-fields legend {
    padding-inline: .3rem;
    font-weight: 800;
}

.page-editor-table-visible th,
.page-editor-table-visible td {
    border: 1px solid var(--cms-border);
}

.page-editor-table-hidden th,
.page-editor-table-hidden td {
    border: 1px dashed rgba(111, 87, 50, .38);
    background: rgba(244, 234, 215, .28);
}

.page-editor-table th:focus,
.page-editor-table td:focus {
    outline: 3px solid var(--cms-focus);
    outline-offset: -3px;
}

.page-editor-surface figure {
    max-width: 100%;
    padding: .75rem;
    border: 1px dashed var(--cms-gold-dark);
    border-radius: .5rem;
}

.page-editor-surface figure img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    object-fit: contain;
}

.page-editor-image-small { width: min(25%, 18rem); }
.page-editor-image-medium { width: min(50%, 32rem); }
.page-editor-image-large { width: min(75%, 52rem); }
.page-editor-image-full { width: 100%; }
.page-editor-image-size-10 { width: 10%; }
.page-editor-image-size-15 { width: 15%; }
.page-editor-image-size-20 { width: 20%; }
.page-editor-image-size-25 { width: 25%; }
.page-editor-image-size-30 { width: 30%; }
.page-editor-image-size-40 { width: 40%; }
.page-editor-image-size-50 { width: 50%; }
.page-editor-image-size-60 { width: 60%; }
.page-editor-image-size-75 { width: 75%; }
.page-editor-image-size-100 { width: 100%; }
.page-editor-image-left { float: left; margin-left: 0; margin-right: 1.25rem; }
.page-editor-image-right { float: right; margin-right: 0; margin-left: 1.25rem; }
.page-editor-image-center { margin-inline: auto; }

.page-editor-surface .page-line-1-0 { line-height: 1; margin-bottom: .25rem; }
.page-editor-surface .page-line-1-15 { line-height: 1.15; margin-bottom: .65rem; }
.page-editor-surface .page-line-1-5 { line-height: 1.5; }
.page-editor-surface .page-line-2-0 { line-height: 2; }
.page-editor-surface .page-align-left { text-align: left; }
.page-editor-surface .page-align-center { text-align: center; }
.page-editor-surface .page-align-right { text-align: right; }
.page-editor-surface .page-align-justify { text-align: justify; }
.page-editor-surface .page-color-charcoal { color: #24211d; }
.page-editor-surface .page-color-gray { color: #667085; }
.page-editor-surface .page-color-red { color: #e00000; }
.page-editor-surface .page-color-orange { color: #e85d04; }
.page-editor-surface .page-color-gold { color: #9a6700; }
.page-editor-surface .page-color-green { color: #16803a; }
.page-editor-surface .page-color-teal { color: #07847e; }
.page-editor-surface .page-color-blue { color: #175cd3; }
.page-editor-surface .page-color-navy { color: #3448a1; }
.page-editor-surface .page-color-purple { color: #7a3e9d; }
.page-editor-surface .page-color-pink { color: #c11574; }
.page-editor-surface .page-color-brown { color: #795548; }
.page-editor-surface .page-size-8 { font-size: 8px; }
.page-editor-surface .page-size-9 { font-size: 9px; }
.page-editor-surface .page-size-10 { font-size: 10px; }
.page-editor-surface .page-size-11 { font-size: 11px; }
.page-editor-surface .page-size-12 { font-size: 12px; }
.page-editor-surface .page-size-14 { font-size: 14px; }
.page-editor-surface .page-size-16 { font-size: 16px; }
.page-editor-surface .page-size-18 { font-size: 18px; }
.page-editor-surface .page-size-20 { font-size: 20px; }
.page-editor-surface .page-size-24 { font-size: 24px; }
.page-editor-surface .page-size-28 { font-size: 28px; }
.page-editor-surface .page-size-32 { font-size: 32px; }

.page-editor-surface figcaption {
    margin-top: .4rem;
    color: var(--cms-muted);
    font-size: .85rem;
}

.page-editor-dialog {
    width: min(92vw, 34rem);
    border: 1px solid var(--cms-border);
    border-radius: .75rem;
    padding: 1.25rem;
    box-shadow: var(--cms-shadow);
}

.page-editor-dialog::backdrop {
    background: rgba(37, 34, 30, .55);
}

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

.cms-danger-zone {
    border: 2px solid var(--cms-error);
    border-radius: .5rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.cms-asset-section {
    display: grid;
    gap: 1rem;
}

.cms-section-heading h2,
.cms-section-heading p,
.cms-asset-current p {
    margin-bottom: .25rem;
}

.cms-asset-current {
    display: flex;
    gap: 1rem;
    align-items: center;
    min-width: 0;
    padding: .75rem;
    background: var(--cms-cream);
    border-radius: .5rem;
}

.cms-asset-preview {
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: .35rem;
}

.cms-asset-preview-small {
    width: 6rem;
    height: 6rem;
}

.cms-asset-preview-wide {
    width: min(18rem, 38vw);
    height: 10rem;
    object-fit: cover;
}

.cms-file-meta {
    overflow-wrap: anywhere;
    color: var(--cms-muted);
    font-size: .75rem;
}

.cms-asset-action {
    max-width: 52rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cms-border);
}

.cms-action-disclosure {
    border-top: 1px solid var(--cms-border);
    padding-top: .75rem;
}

.cms-action-disclosure summary {
    color: var(--cms-gold-dark);
    cursor: pointer;
    font-weight: 800;
}

.cms-action-disclosure[open] summary {
    margin-bottom: 1rem;
}

/*
 * menu.php: one collapsed-by-default disclosure per existing menu entry
 * (the "add new" entry stays open) -- a density fix for a page that used
 * to always render every entry's full 6-field form expanded, regardless
 * of how many entries existed. No border-top/padding-top here (unlike the
 * base .cms-action-disclosure, meant to divide a disclosure from
 * preceding sibling content within the same panel): this disclosure IS
 * the entire .cms-panel card's content, so a top border would just
 * duplicate the card's own top edge. Summary sized close to a heading
 * (.cms-panel's own h2 is 1.18rem) since it visually replaces one.
 */
.cms-menu-entry-disclosure {
    border-top: 0;
    padding-top: 0;
}

.cms-menu-entry-disclosure summary {
    font-size: 1.1rem;
}

/*
 * amenities.php/prices.php: both pages always render one section per
 * catalogue resource (all 5), regardless of which one the operator
 * navigated to via the tabs/?resource_id= -- see the "Pokoj č. 1 / all
 * rooms" root-cause note in docs/PHASE1_DESIGN_SYSTEM.md. This batch does
 * not change that (no filtering/business-rule change), but collapsing
 * every non-selected resource's section by default, like
 * .cms-menu-entry-disclosure, makes the page far shorter and makes the
 * one the operator actually came here for unambiguous -- same shape as
 * .cms-menu-entry-disclosure (this disclosure IS the whole card's
 * content, so no extra top border).
 */
.cms-resource-section-disclosure { border-top: 0; padding-top: 0; }
.cms-resource-section-disclosure summary { font-size: 1.1rem; }
/*
 * The one section matching the room/resource the operator actually
 * navigated to (?resource_id=N / the active tab) -- a left accent on the
 * whole card, not just its summary, so it reads clearly even before the
 * details element is opened.
 */
.cms-panel.is-selected-resource { border-left: 3px solid var(--cms-gold-dark); }

.cms-compact-action {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.cms-media-list {
    display: grid;
    gap: .75rem;
}

.cms-media-row {
    display: grid;
    grid-template-columns: 8rem minmax(14rem, 1fr) minmax(12rem, .6fr);
    gap: .75rem;
    align-items: start;
    padding: .7rem;
    border-bottom: 1px solid var(--cms-border);
    border-radius: .5rem;
    background: var(--cms-white);
}

/* Same left-accent (not opacity) convention as .cms-seasonal-row.is-inactive above. */
.cms-media-row.is-inactive { border-left: 3px solid var(--cms-border-strong); padding-left: calc(.7rem - 3px); background: var(--cms-cream); }

.cms-media-row > img {
    width: 8rem;
    height: 6rem;
    object-fit: cover;
    border-radius: .35rem;
}

.cms-media-row-content,
.cms-media-row-controls {
    display: grid;
    gap: .5rem;
    min-width: 0;
}

.cms-media-row-controls > label {
    max-width: 7rem;
}

/*
 * Browser-acceptance correction #3 (gallery.php / .cms-gallery-page only,
 * supersedes corrections #1 and #2's .cms-media-controls-line/.cms-media-
 * order-field approach -- neither class is referenced by any markup any
 * more, removed rather than left as dead CSS): the real requirement was
 * never just "one line" (#2) -- it's that Pořadí must read as its own
 * label-above/input-below pair, exactly like Alternativní text, with the
 * two INPUTS (not the labels) sharing one visual baseline together with
 * the checkboxes and action buttons.
 *
 * .cms-media-row-content (the shared rule two rules above: display: grid,
 * single column, gap: .5rem) already produces exactly that shape for
 * Alternativní text with zero changes needed: row 1 = label, row 2 =
 * input, row 3 = the metadata disclosure. .cms-media-row-controls, a
 * SEPARATE, independent grid one column over, is given the matching
 * two-row shape here: row 1 = the Pořadí label only, row 2 = the order
 * input + the state checkboxes + the actions, all three placed in row 2
 * via named grid areas and vertically centred against each other.
 *
 * This works without CSS subgrid (broad support risk not worth taking for
 * one page) because the two grids never need to share a grid line, only
 * produce the SAME row 1 height and the SAME row-gap -- guaranteed here by
 * construction: row 1 in both grids holds nothing but one line of label
 * text (same global `label` rule, same font-size/weight in both), row 2 in
 * both grids has a real <input> as its tallest cell (same global `input`
 * rule in both), and row-gap is set to the identical .5rem the shared
 * .cms-media-row-content/.cms-media-row-controls rule above already uses.
 * Page-scoped, not a change to that shared rule or to .cms-media-row-
 * controls > label (immediately above) -- accommodation-images.php keeps
 * its own, differently-shaped .cms-accommodation-order-input sibling pair
 * and was not browser-reviewed as part of this correction.
 */
.cms-gallery-page .cms-media-row {
    grid-template-columns: 8rem minmax(14rem, 1fr) max-content;
}

.cms-gallery-page .cms-media-row-controls {
    display: grid;
    grid-template-columns: max-content max-content auto;
    grid-template-areas:
        "order-label . ."
        "order-input states actions";
    column-gap: .75rem;
    row-gap: .5rem;
    align-items: center;
}

.cms-gallery-page .cms-media-order-label {
    grid-area: order-label;
}

.cms-gallery-page .cms-media-order-input {
    grid-area: order-input;
    width: 4.5rem;
}

.cms-gallery-page .cms-media-states {
    grid-area: states;
}

.cms-gallery-page .cms-media-row-actions {
    grid-area: actions;
}

.cms-media-states {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
}

.cms-media-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.cms-media-row-actions .cms-button {
    min-height: 2.35rem;
    padding: .45rem .65rem;
}

.cms-media-metadata summary,
.cms-delete-confirmation summary {
    cursor: pointer;
}

.cms-media-metadata summary {
    color: var(--cms-muted);
    font-size: .8rem;
}

.cms-delete-confirmation {
    position: relative;
}

.cms-delete-confirmation > summary {
    list-style: none;
}

.cms-delete-confirmation > summary::-webkit-details-marker {
    display: none;
}

.cms-delete-confirmation-panel {
    display: grid;
    position: absolute;
    z-index: 2;
    right: 0;
    width: min(22rem, 80vw);
    gap: .65rem;
    padding: .85rem;
    margin-top: .35rem;
    border: 1px solid var(--cms-error);
    border-radius: .5rem;
    background: var(--cms-white);
    box-shadow: var(--cms-shadow);
}

.cms-delete-confirmation-panel p {
    margin: 0;
}

.cms-button-danger-subtle {
    color: var(--cms-error);
    background: transparent;
    border-color: currentColor;
}

/*
 * Browser-acceptance correction #1 (gallery.php only): "Použít existující
 * fotografii" replaces a text-only <select> (an id/filename is not enough
 * to recognise a photograph) with a compact thumbnail radio-group. Same
 * "real <input> absolutely covering the card, opacity: 0, :has(input:
 * checked) for the selected state" convention as .cms-branding-swatch
 * (marie-admin/branding.php) above, an already-reviewed pattern, not a new
 * one. New class names, unused elsewhere, so unscoped is safe. auto-fill/
 * minmax handles the responsive column reduction on its own -- no extra
 * @media rule needed.
 */
/*
 * CMS-UI-3B-1 browser-acceptance correction #1: 6rem produced ~14-15 tiny
 * columns at the tested desktop content width (.cms-main's own min(100%,
 * 97.5rem) cap) -- thumbnails unrecognisable, the grid read as a dense
 * database matrix rather than a visual chooser. 11rem lands the same
 * auto-fill/minmax convention at the requested ~7-9 columns on that same
 * width, and still degrades gracefully at any narrower viewport with no
 * extra @media rule, exactly like the original rule did.
 */
.cms-media-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: .75rem;
}

.cms-media-pick {
    position: relative;
    display: grid;
    gap: .35rem;
    padding: .5rem;
    border: 1px solid var(--cms-border);
    border-radius: .5rem;
    background: var(--cms-white);
    cursor: pointer;
}

.cms-media-pick img {
    width: 100%;
    height: 7.5rem;
    object-fit: cover;
    border-radius: .35rem;
}

.cms-media-pick span {
    font-size: .72rem;
    color: var(--cms-muted);
    text-align: center;
    overflow-wrap: break-word;
}

/*
 * The #id — alt-text label only -- marie_cms_render_media_picker()
 * (includes/cms.php) gives it this dedicated class specifically so it can
 * be clamped independently of the usage-state badge below (both are plain
 * <span> children of the same card, so a bare ".cms-media-pick span"
 * selector alone could not tell them apart). Long alt text no longer makes
 * an individual card grow tall and uneven next to its neighbours.
 */
.cms-media-pick-label {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/*
 * The informational Použito/Nepoužito badge -- .cms-media-pick is a
 * single-column grid (no grid-template-columns of its own), so every
 * child stretches to the card's full width by default; that is exactly
 * why the badge previously read as a large, dominant, button-like block
 * instead of a small status chip. justify-self: start shrinks it back to
 * its own content width; the smaller font-size/padding make it visually
 * secondary to the photograph and label, per the accepted correction --
 * .is-active/.is-inactive (assets/cms.css, existing rule) still own its
 * colour, so "Použito" keeps exactly its current meaning and remains
 * fully readable, just no longer dominant. Never disables the card --
 * selection is still the whole label's own radio input.
 */
.cms-media-pick .cms-status {
    justify-self: start;
    font-size: .68rem;
    padding: .15rem .45rem;
}

.cms-media-pick input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    opacity: 0;
}

.cms-media-pick:has(input:checked) {
    border-color: var(--cms-gold-dark);
    background: var(--cms-gold-light);
}

/* The real input is visually hidden (opacity: 0) over the whole card, so
   the global :focus-visible rule would draw its ring around that invisible
   element -- redirected onto the visible card, same as .cms-branding-swatch
   above. */
.cms-media-pick:has(input:focus-visible) {
    outline: 3px solid rgba(var(--cms-gold-rgb), .32);
    outline-offset: 2px;
}

/*
 * Media Library grid (marie-admin/media.php) -- deliberately mirrors
 * .cms-media-picker/.cms-media-pick above (same card shape, same border/
 * radius/hover language) rather than inventing a new visual style, since
 * this is the same "browse thumbnails" idiom already established there,
 * Gallery and Site Assets; it differs only in being a real link (not a
 * radio input) and carrying a status badge + metadata line per card.
 */
.cms-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: .75rem;
}

.cms-media-grid-item {
    display: grid;
    gap: .35rem;
    padding: .5rem;
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
    background: var(--cms-white);
    color: inherit;
    text-decoration: none;
}

.cms-media-grid-item:hover,
.cms-media-grid-item:focus-visible {
    border-color: var(--cms-gold-dark);
    outline: none;
}

.cms-media-grid-item img {
    width: 100%;
    height: 6.5rem;
    object-fit: cover;
    border-radius: .35rem;
}

.cms-media-grid-item-body {
    display: grid;
    gap: .25rem;
}

.cms-media-grid-item-label {
    font-size: .82rem;
    font-weight: 600;
    overflow-wrap: break-word;
}

.cms-media-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.cms-media-detail-preview {
    width: 100%;
    border-radius: var(--cms-radius-sm);
    border: 1px solid var(--cms-border);
}

/*
 * .cms-detail-list's generic base rule (above) is a 2-column CARD-TILE
 * grid meant for wrapping each field in its own cream <div> (dt stacked
 * above dd) -- see the reservation-detail-page's own override further up
 * for that same idea at 3 tiles per row. The Media Library detail view
 * uses the bare <dt>/<dd> pairs directly (no wrapping <div>), so the base
 * rule instead put each label and value in its own 50%-width column of
 * the wide right-hand pane, leaving a large gap between a short label and
 * its value -- most visible on the SHA-256 row. Scoped to .cms-media-
 * detail-layout only (never touching the generic .cms-detail-list rule
 * every other page still relies on): a compact label|value row grid
 * (label column only as wide as its longest label needs, value column
 * flexible but capped by the panel's own max-width) instead of the tile
 * grid, and the panel itself no longer stretches to the full remaining
 * page width.
 */
.cms-media-detail-layout .cms-detail-list {
    grid-template-columns: minmax(auto, 11rem) minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.6rem;
    max-width: 28rem;
}

.cms-media-detail-layout .cms-detail-list dt {
    align-self: start;
    padding-top: 0.15rem;
}

.cms-media-detail-layout .cms-detail-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.cms-usage-list {
    margin: 0;
    padding-left: 1.25rem;
}

@media (max-width: 48rem) {
    .cms-media-detail-layout {
        grid-template-columns: 1fr;
    }
}

.cms-confirm-dialog {
    width: min(92vw, 34rem);
    border: 1px solid var(--cms-border);
    border-radius: .75rem;
    padding: 1.5rem;
    box-shadow: var(--cms-shadow);
}

.cms-confirm-dialog::backdrop {
    background: rgba(37, 34, 30, .58);
}

/*
 * site-assets.php ("Logo a obrázky webu"): one card per image slot (preview,
 * plain-language state, "Změnit obrázek" / "Odstranit obrázek", collapsed
 * "Pokročilá nastavení"), and one "Změnit obrázek" <dialog> per slot with
 * the upload and media-library tabs. The forms inside are the page's
 * existing upload/select/settings/deactivate POSTs; the library tab is the
 * shared .cms-media-picker. Without JavaScript, assets/cms-no-js.css shows
 * each change dialog inline instead (see there).
 */
/*
 * Exactly two equal columns, filled in source order: logo | favicon, then
 * hero | sharing. One column below 66rem: with the desktop sidebar (17rem)
 * and .cms-main's 2rem side padding, that is where two ~22rem cards (two
 * action buttons side by side) stop fitting comfortably; below 52rem the
 * sidebar is off-canvas and one column is kept for the narrower content.
 */
.cms-site-asset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

@media (max-width: 66rem) {
    .cms-site-asset-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cms-site-asset-card {
    display: grid;
    gap: 1rem;
    min-width: 0;
    margin-bottom: 0;
}

.cms-site-asset-preview-frame {
    display: grid;
    place-items: center;
    height: 11rem;
    overflow: hidden;
    background: var(--cms-cream);
    border: 1px solid var(--cms-border);
    border-radius: .5rem;
}

/* Hero and sharing photographs (one shared height for both): a taller
   frame; the cover crop itself is unchanged. */
.cms-site-asset-preview-frame-photo {
    height: 16rem;
}

/*
 * Logo and favicon: natural proportions, never stretched or cropped,
 * centred in the frame (contain, bounded by the frame minus padding). The
 * shared .cms-asset-preview-small 6rem square stays the default elsewhere.
 */
.cms-site-asset-card .cms-asset-preview-small {
    width: auto;
    height: auto;
    max-width: calc(100% - 2rem);
    max-height: 9rem;
    object-fit: contain;
}

/* Fill the frame; .cms-asset-preview-wide's own min(18rem, 38vw) size stays
   the shared default for every other page. */
.cms-site-asset-card .cms-asset-preview-wide {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.cms-site-asset-empty {
    margin: 0;
    padding: 1rem;
    color: var(--cms-muted);
    font-weight: 700;
    text-align: center;
}

.cms-site-asset-summary {
    display: grid;
    gap: .5rem;
    min-width: 0;
}

.cms-site-asset-summary h2,
.cms-site-asset-summary p {
    margin: 0;
}

.cms-site-asset-state {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.cms-site-asset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: .25rem;
}

.cms-site-asset-advanced .cms-form,
.cms-site-asset-dialog .cms-form {
    gap: .5rem;
}

.cms-site-asset-advanced .cms-help,
.cms-site-asset-dialog .cms-help {
    margin: 0;
}

.cms-site-asset-advanced .cms-form-actions,
.cms-site-asset-dialog .cms-form-actions {
    margin-top: .5rem;
}

.cms-site-asset-details {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: .35rem 1rem;
    margin: 1rem 0 0;
    font-size: .85rem;
}

.cms-site-asset-details dt {
    color: var(--cms-muted);
    font-weight: 700;
}

.cms-site-asset-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.cms-site-asset-remove-panel {
    padding: 1rem;
    border: 1px solid var(--cms-error);
    border-radius: .5rem;
}

.cms-site-asset-remove-panel h2,
.cms-site-asset-remove-dialog h2 {
    margin-bottom: .75rem;
    font-size: 1.1rem;
}

.cms-site-asset-remove-text {
    margin: 0 0 1rem;
    color: var(--cms-charcoal);
}

.cms-site-asset-dialog {
    width: min(calc(100vw - 2rem), 52rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--cms-border);
    border-radius: .75rem;
    box-shadow: var(--cms-shadow);
}

.cms-site-asset-dialog::backdrop {
    background: rgba(37, 34, 30, .58);
}

.cms-site-asset-dialog-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--cms-white);
    border-bottom: 1px solid var(--cms-border);
}

.cms-site-asset-dialog-header h2 {
    margin: 0;
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.cms-site-asset-dialog-body {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    min-width: 0;
}

.cms-site-asset-tabs {
    display: flex;
    gap: .25rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--cms-border);
}

.cms-site-asset-tabs [role="tab"] {
    flex: 0 0 auto;
    min-height: 2.75rem;
    margin-bottom: -1px;
    padding: .6rem 1rem;
    color: var(--cms-muted);
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
}

.cms-site-asset-tabs [role="tab"][aria-selected="true"] {
    color: var(--cms-charcoal);
    border-bottom-color: var(--cms-gold-dark);
}

.cms-site-asset-tabs [role="tab"]:focus-visible,
.cms-site-asset-tabpanel:focus-visible {
    outline: 3px solid rgba(var(--cms-gold-rgb), .32);
    outline-offset: 2px;
}

.cms-site-asset-tabpanel {
    min-width: 0;
}

/* Only shown without JavaScript (assets/cms-no-js.css), where both panels
   are visible at once and the tab buttons are hidden. */
.cms-site-asset-panel-title {
    display: none;
}

.cms-site-asset-upload-preview {
    display: grid;
    gap: .35rem;
    justify-items: start;
    margin: .25rem 0;
}

.cms-site-asset-upload-preview[hidden] {
    display: none;
}

.cms-site-asset-upload-preview img {
    max-width: 100%;
    max-height: 14rem;
    object-fit: contain;
    background: var(--cms-cream);
    border: 1px solid var(--cms-border);
    border-radius: .35rem;
}

.cms-site-asset-upload-preview figcaption {
    color: var(--cms-muted);
    font-size: .75rem;
}

@media (max-width: 36rem) {
    .cms-site-asset-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .cms-site-asset-dialog-header,
    .cms-site-asset-dialog-body {
        padding-inline: 1rem;
    }

    .cms-site-asset-actions .cms-button {
        flex: 1 1 100%;
    }
}

@media (max-width: 48rem) {
    .cms-asset-current,
    .cms-media-row {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .cms-asset-preview-wide,
    .cms-media-row > img {
        width: min(100%, 18rem);
    }

    .cms-media-row-actions {
        justify-content: flex-start;
    }

    /*
     * .cms-gallery-page's desktop layout rules (above) are unconditional
     * (higher specificity than the shared .cms-media-row/.cms-media-row-
     * controls rules, since they carry the extra .cms-gallery-page class)
     * -- without this, they would keep winning at narrow widths too and
     * defeat the shared stacking above. Reverts .cms-media-row-controls to
     * a plain single-column flex stack (order label, order input, state
     * checkboxes, actions, each full width in DOM order) -- the label-
     * above-input alignment this correction is about is a desktop-only
     * concern once the row has already stacked into one column.
     */
    .cms-gallery-page .cms-media-row {
        grid-template-columns: 1fr;
    }

    .cms-gallery-page .cms-media-row-controls {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .cms-delete-confirmation-panel {
        position: static;
        width: 100%;
    }

    .page-editor-toolbar {
        gap: .45rem;
        width: 100%;
        flex-wrap: wrap;
    }

    .page-editor-format {
        width: 100%;
    }

    .page-editor-color-palette {
        right: 0;
        left: auto;
    }

}

/* Transactional e-mail template editor (marie-admin/email-template.php).
   CSP is style-src 'self', so this screen carries no inline styles; the shared
   .cms-help / .cms-form-actions rules assume the two-column .cms-form-grid, but
   this editor is single-column. Scoped so no other CMS screen is affected. */
.cms-form.cms-email-template-form {
    grid-template-columns: minmax(0, 1fr);
}

.cms-email-template-form > * {
    grid-column: 1;
    min-width: 0;
}

.cms-email-template-form > .cms-help,
.cms-email-template-form > .cms-form-actions {
    grid-column: 1;
}

.cms-email-template-form .cms-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.cms-email-template-body {
    min-height: 20rem;
    font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.cms-email-template-banner {
    margin: 0;
    white-space: pre-wrap;
}

.cms-email-template-preview {
    display: block;
    width: 100%;
    height: 32.5rem; /* ~520px */
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 0.25rem;
}

.cms-reservation-cancel-preview {
    margin: 1rem 0;
}

.cms-email-template-text {
    margin: 0;
    padding: 0.75rem;
    background: var(--cms-ivory);
    border: 1px solid var(--cms-border);
    border-radius: 0.25rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* DAT Consulting CMS shell: active nav, bell, dashboard, branding */

/* Uploaded logo variant of .cms-brand-mark: a plain fitted image, not the
   "M" mark's grid/background/border pill -- reuses the same width/height
   footprint (3rem in the auth card, 2.6rem in the header/sidebar) so an
   operator-uploaded logo of any aspect ratio drops into the same slot. */
.cms-brand-mark-image {
    display: block;
    background: none;
    border: 0;
    border-radius: 0.35rem;
    object-fit: contain;
}

/*
 * Active item: accent background + glow shadow + a flush white left rail,
 * matching the reference CMS's own aria-current[page] treatment. Text
 * stays white in every state (hover/focus/focus-visible/active/visited),
 * matching the same always-white requirement already applied to
 * .cms-button-primary above -- never dependent on the operator's saved
 * accent colour. This used to be dark charcoal text (a deliberate earlier
 * choice, made for contrast against a light saved accent), which visually
 * read as an unstyled/broken-looking dark label sitting on the gold
 * highlight; reasserted explicitly below so hover/focus/:visited can't
 * silently fall back to it.
 */
.cms-sidebar a[aria-current="page"] {
    position: relative;
    color: var(--cms-white);
    background: var(--cms-gold);
    border-radius: 0.55rem;
    box-shadow: 0 6px 18px rgba(var(--cms-gold-rgb), 0.22);
}

.cms-sidebar a[aria-current="page"]:hover,
.cms-sidebar a[aria-current="page"]:focus,
.cms-sidebar a[aria-current="page"]:focus-visible,
.cms-sidebar a[aria-current="page"]:active,
.cms-sidebar a[aria-current="page"]:visited {
    color: var(--cms-white);
}

.cms-sidebar a[aria-current="page"]::before {
    position: absolute;
    left: -1rem;
    width: 3px;
    height: 1.35rem;
    border-radius: 0 3px 3px 0;
    background: var(--cms-white);
    content: "";
}

.cms-topbar-end {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cms-notification-panel {
    position: relative;
}

.cms-notification-bell {
    display: flex;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 50%;
    cursor: pointer;
    list-style: none;
}

.cms-notification-bell::-webkit-details-marker {
    display: none;
}

.cms-notification-count {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 1.25rem;
    padding: 0 0.3rem;
    color: #211b12;
    background: var(--cms-gold);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
}

.cms-notification-panel-body {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 20;
    width: min(22rem, 90vw);
    padding: 1rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 0.75rem;
    box-shadow: var(--cms-shadow);
}

.cms-notification-panel-header {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cms-notification-panel-header h2 {
    margin: 0;
    font-size: 1rem;
}

.cms-notification-list {
    display: grid;
    max-height: 22rem;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    list-style: none;
    overflow-y: auto;
}

.cms-notification-list li {
    display: flex;
    padding: 0.6rem 0.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 0.5rem;
}

.cms-notification-list li.is-unread {
    background: var(--cms-gold-light);
}

.cms-notification-list a,
.cms-notification-list span {
    display: block;
    color: inherit;
    font-size: 0.85rem;
    text-decoration: none;
}

.cms-notification-list time {
    display: block;
    color: var(--cms-muted);
    font-size: 0.72rem;
}

.cms-notification-empty {
    color: var(--cms-muted);
    font-size: 0.85rem;
}

.cms-button-link {
    padding: 0;
    color: var(--cms-gold-dark);
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.cms-status-new {
    color: var(--cms-gold-dark);
    background: var(--cms-gold-light);
}

.cms-dashboard-summary {
    display: grid;
    margin-bottom: 1.5rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.cms-dashboard-summary-card {
    display: grid;
    padding: 1.25rem;
    gap: 0.35rem;
    color: inherit;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    text-decoration: none;
}

.cms-dashboard-summary-card.is-highlighted {
    border-color: var(--cms-gold);
    box-shadow: 0 0 0 0.15rem var(--cms-gold-light);
}

.cms-dashboard-summary-card strong {
    font-size: 1.75rem;
}

.cms-dashboard-summary-card span {
    color: var(--cms-muted);
    font-size: 0.85rem;
}

/*
 * Dashboard (marie-admin/dashboard.php) only -- every rule below is
 * .cms-dash-* or scoped to body.cms-dashboard-page. The shared
 * .cms-dashboard-summary/-card rules above stay untouched: the Platby a
 * doklady overview (marie_bank_cms_overview_summary_html()) still uses them.
 */
.cms-dashboard-page .cms-main {
    padding-top: 1.75rem;
}

.cms-dash-heading {
    margin-bottom: 1.25rem;
}

.cms-dash-heading h1 {
    margin-bottom: 0.15rem;
    font-size: 1.5rem;
}

.cms-dash-heading p {
    margin: 0;
    color: var(--cms-muted);
    font-size: 0.9rem;
}

.cms-dash-kpis {
    display: grid;
    margin-bottom: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.cms-dash-kpi {
    --cms-dash-accent: #334155;
    --cms-dash-accent-soft: #e8edf3;
    display: grid;
    padding: 0.85rem 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label icon"
        "value icon";
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    align-items: start;
    color: inherit;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-left: 3px solid var(--cms-dash-accent-soft);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
    text-decoration: none;
    transition: border-color 150ms, box-shadow 150ms;
}

.cms-dash-kpi:hover {
    border-color: var(--cms-border-strong);
    border-left-color: var(--cms-dash-accent);
    box-shadow: var(--cms-shadow);
}

.cms-dash-kpi:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
}

.cms-dash-kpi-new {
    --cms-dash-accent: var(--cms-gold-dark);
    --cms-dash-accent-soft: var(--cms-gold-light);
}

.cms-dash-kpi-pending {
    --cms-dash-accent: #6e4700;
    --cms-dash-accent-soft: #fff0c2;
}

.cms-dash-kpi-deposit {
    --cms-dash-accent: #12542f;
    --cms-dash-accent-soft: #d8f3e3;
}

.cms-dash-kpi.is-highlighted {
    border-color: var(--cms-gold);
    border-left-color: var(--cms-gold);
    box-shadow: 0 0 0 0.15rem var(--cms-gold-light);
}

.cms-dash-kpi-label {
    grid-area: label;
    color: var(--cms-muted);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
}

.cms-dash-kpi-value {
    grid-area: value;
    color: var(--cms-charcoal);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.cms-dash-kpi-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    grid-area: icon;
    place-items: center;
    color: var(--cms-dash-accent);
    background: var(--cms-dash-accent-soft);
    border-radius: 0.55rem;
}

.cms-dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(16rem, 1fr);
    gap: 1rem;
    align-items: start;
}

.cms-dash-side {
    display: grid;
    gap: 1rem;
}

.cms-dash-panel {
    padding: 1rem 1.1rem;
    margin-bottom: 0;
}

.cms-dash-panel-header {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}

.cms-dash-panel h2 {
    margin: 0;
    font-size: 1rem;
}

.cms-dash-panel h2 small {
    color: var(--cms-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.cms-dash-panel-link {
    color: var(--cms-gold-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.cms-dash-subheading {
    margin: 1rem 0 0.5rem;
    color: var(--cms-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cms-dash-empty {
    display: flex;
    padding: 0.85rem 1rem;
    align-items: center;
    gap: 0.75rem;
    background: var(--cms-ivory);
    border: 1px dashed var(--cms-border);
    border-radius: var(--cms-radius-sm);
}

.cms-dash-empty p,
.cms-dash-empty h2 {
    margin: 0;
}

.cms-dash-empty h2 + p {
    margin-top: 0.2rem;
}

.cms-dash-empty p {
    font-size: 0.875rem;
}

.cms-dash-empty-icon {
    display: grid;
    flex: none;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: var(--cms-muted);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 50%;
}

.cms-dash-empty-ok .cms-dash-empty-icon {
    color: var(--cms-success);
}

.cms-dash-stays,
.cms-dash-actions,
.cms-dash-alerts {
    display: grid;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Two compact rows per stay (guest + status / dates + detail) so the list
   reads well at every column width without a horizontally scrolling table. */
.cms-dash-stay {
    display: grid;
    padding: 0.7rem 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "guest status"
        "dates link";
    gap: 0.4rem 0.75rem;
    align-items: center;
    border-top: 1px solid var(--cms-border);
}

.cms-dash-stay:first-child {
    padding-top: 0;
    border-top: 0;
}

.cms-dash-stay:last-child {
    padding-bottom: 0;
}

.cms-dash-stay-guest {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    grid-area: guest;
    align-items: center;
    gap: 0.25rem 0.45rem;
}

.cms-dash-stay-guest strong {
    overflow-wrap: anywhere;
    font-size: 0.925rem;
}

.cms-dash-stay-guest small {
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.cms-dash-stay > .cms-status {
    grid-area: status;
    justify-self: end;
    text-align: right;
}

.cms-dash-stay-dates {
    display: flex;
    flex-wrap: wrap;
    grid-area: dates;
    margin: 0;
    gap: 0.25rem 1.25rem;
}

.cms-dash-stay-dates div {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.cms-dash-stay-dates dt {
    color: var(--cms-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cms-dash-stay-dates dd {
    margin: 0;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.cms-dash-stay-dates .is-today dd {
    font-weight: 700;
}

.cms-dash-today {
    padding: 0.05rem 0.4rem;
    color: var(--cms-gold-dark);
    background: var(--cms-gold-light);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
}

.cms-dash-stay-link.cms-button {
    min-height: 2rem;
    padding: 0.3rem 0.75rem;
    grid-area: link;
    justify-self: end;
    font-size: 0.8rem;
}

.cms-dash-actions {
    gap: 0.4rem;
}

.cms-dash-action {
    display: flex;
    min-height: 2.5rem;
    padding: 0.45rem 0.65rem;
    align-items: center;
    gap: 0.65rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 150ms, background-color 150ms;
}

.cms-dash-action:hover {
    background: var(--cms-ivory);
    border-color: var(--cms-gold-dark);
}

.cms-dash-action-icon,
.cms-dash-alert-icon {
    display: grid;
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    color: var(--cms-gold-dark);
    background: var(--cms-gold-light);
    border-radius: 0.45rem;
}

.cms-dash-new {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.cms-dash-new .cms-button {
    min-height: 2.35rem;
    padding: 0.45rem 0.6rem;
    gap: 0.35rem;
    font-size: 0.82rem;
    text-align: center;
}

.cms-dash-new .cms-button svg {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.cms-dash-alerts {
    gap: 0.4rem;
}

.cms-dash-alert {
    display: flex;
    padding: 0.5rem 0.65rem;
    align-items: center;
    gap: 0.65rem;
    color: var(--cms-charcoal);
    background: #fffaf0;
    border: 1px solid #f1dfb0;
    border-radius: var(--cms-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.cms-dash-alert:hover {
    border-color: var(--cms-gold-dark);
}

.cms-dash-alert span:not(.cms-dash-alert-icon) {
    flex: 1 1 auto;
    min-width: 0;
}

.cms-dash-alert-icon {
    color: #6e4700;
    background: #fff0c2;
}

.cms-dash-alert strong {
    min-width: 1.6rem;
    padding: 0 0.45rem;
    color: #6e4700;
    background: #fff0c2;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* DASHBOARD-MVP: operational KPI accents, the optional note under a KPI value,
   the compact requests panel and the Booking.com panel. */
.cms-dash-kpi {
    grid-template-areas:
        "label icon"
        "value icon"
        "note note";
}

.cms-dash-kpi-note {
    grid-area: note;
    color: var(--cms-muted);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.cms-dash-kpi-arrival {
    --cms-dash-accent: #12542f;
    --cms-dash-accent-soft: #d8f3e3;
}

.cms-dash-kpi-departure {
    --cms-dash-accent: var(--cms-gold-dark);
    --cms-dash-accent-soft: var(--cms-gold-light);
}

.cms-dash-kpi-unpaid {
    --cms-dash-accent: #6e4700;
    --cms-dash-accent-soft: #fff0c2;
}

.cms-dash-main {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.cms-dash-stay.is-today {
    padding-left: 0.75rem;
    box-shadow: inset 3px 0 0 var(--cms-gold);
}

.cms-dash-more {
    margin: 0.75rem 0 0;
    color: var(--cms-muted);
    font-size: 0.85rem;
}

.cms-dash-counts {
    display: grid;
    padding: 0;
    margin: 0;
    gap: 0.4rem;
    list-style: none;
}

.cms-dash-count {
    display: flex;
    min-height: 2.5rem;
    padding: 0.45rem 0.65rem;
    align-items: center;
    gap: 0.65rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 150ms, background-color 150ms;
}

.cms-dash-count:hover {
    background: var(--cms-ivory);
    border-color: var(--cms-gold-dark);
}

.cms-dash-count.is-highlighted {
    border-color: var(--cms-gold);
    box-shadow: 0 0 0 0.15rem var(--cms-gold-light);
}

.cms-dash-count span:not(.cms-dash-count-icon) {
    flex: 1 1 auto;
    min-width: 0;
}

.cms-dash-count-icon {
    display: grid;
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    color: var(--cms-gold-dark);
    background: var(--cms-gold-light);
    border-radius: 0.45rem;
}

.cms-dash-count strong {
    min-width: 1.6rem;
    font-size: 0.95rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cms-dash-booking-note {
    padding: 0.6rem 0.75rem;
    margin: 0 0 0.75rem;
    background: var(--cms-ivory);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
    font-size: 0.85rem;
}

.cms-dash-facts {
    display: grid;
    margin: 0 0 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.5rem 1rem;
}

.cms-dash-facts dt {
    color: var(--cms-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cms-dash-facts dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cms-dash-rooms {
    display: grid;
    padding: 0;
    margin: 0;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.5rem;
    list-style: none;
}

.cms-dash-room {
    min-width: 0;
    padding: 0.6rem 0.75rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
}

.cms-dash-room-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 0.5rem;
}

.cms-dash-room-head strong {
    font-size: 0.9rem;
}

.cms-dash-room-meta {
    margin: 0.35rem 0 0;
    color: var(--cms-muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

@media (max-width: 80rem) {
    .cms-dash-grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(15rem, 1fr);
    }
}

@media (max-width: 72rem) {
    .cms-dash-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 64rem) {
    .cms-dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Side panels sit next to each other while there is room for both. */
    .cms-dash-side {
        grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
        align-items: start;
    }
}

@media (max-width: 52rem) {
    .cms-dashboard-page .cms-main {
        padding-top: 1.25rem;
    }
}

@media (max-width: 36rem) {
    .cms-dash-kpi {
        padding: 0.7rem 0.75rem;
        grid-template-areas:
            "label label"
            "value icon"
            "note note";
        align-items: end;
    }

    .cms-dash-kpi-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .cms-dash-kpi-value {
        font-size: 1.3rem;
    }
}

@media (max-width: 22rem) {
    .cms-dash-kpis,
    .cms-dash-new {
        grid-template-columns: minmax(0, 1fr);
    }
}

/*
 * Branding page: a dedicated, self-contained layout system -- .cms-branding-
 * prefixed only, never the generic .cms-panel/.cms-stack/.cms-help/
 * .cms-form-actions classes those rely elsewhere. Those generic classes are
 * correct for their own pages, but .cms-help and .cms-form-actions in
 * particular carry a `grid-column: 2` rule (below, near .cms-form-grid)
 * written for a plain two-column label/field form -- reused inside any
 * other display:grid container, that rule forces the browser to invent a
 * narrow implicit second column and exiles that exact content into it. That
 * was the actual root cause of the a308ef3 regression (huge blank areas,
 * scattered fields, actions overlapping content, word-by-word wrapping),
 * not the .cms-stack column override it was chasing -- so this page now
 * avoids every one of those shared classes entirely rather than layering
 * more overrides on top.
 */
.cms-branding-form {
    display: grid;
    gap: 1.5rem;
}

/*
 * Two equal columns sized to the widest button label (max-content of the
 * 1fr tracks), so "Uložit změny", "Zrušit změny" and the bottom group's
 * row-2 "Zpět na přehled" share one width and stay left-aligned.
 */
.cms-branding-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 0.75rem;
    width: max-content;
    max-width: 100%;
}

/*
 * The two-column desktop shape lives entirely in named grid areas, not DOM
 * order plus generic stacking -- so the intended alignment is explicit and
 * inspectable here, not an emergent side effect: "accent" and "preview"
 * share one row, so the preview card's top edge is exactly the accent
 * card's top edge, never the actions above or the company card. Every
 * other left-column card sits under "accent" in its own full-width row;
 * "preview" continues to span every row down to "favicon", so it never
 * looks orphaned once the left column runs longer than the preview's own
 * content (sticky below keeps it visible without moving it out of that
 * span). DOM order already matches this top-to-bottom reading, so the
 * narrow-viewport override below only has to remove the second column.
 */
.cms-branding-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    grid-template-areas:
        "company    company"
        "accent     preview"
        "background preview"
        "logo-light preview"
        "logo-dark  preview"
        "favicon    preview";
    gap: 1.5rem;
    align-items: start;
}

.cms-branding-grid-area-company { grid-area: company; }
.cms-branding-grid-area-accent { grid-area: accent; }
.cms-branding-grid-area-background { grid-area: background; }
.cms-branding-grid-area-logo-light { grid-area: logo-light; }
.cms-branding-grid-area-logo-dark { grid-area: logo-dark; }
.cms-branding-grid-area-favicon { grid-area: favicon; }

/*
 * Every branding card: one flat, single implementation, sized by its own
 * content -- never nested inside another bordered/backgrounded wrapper, so
 * there is exactly one border and one background per card, never two.
 */
.cms-branding-card {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    padding: 1.5rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
}

.cms-branding-card h2 {
    margin-bottom: 0.25rem;
}

.cms-branding-card-description,
.cms-branding-help {
    margin-bottom: 0.5rem;
    color: var(--cms-muted);
    font-size: 0.85rem;
}

.cms-branding-name-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.cms-branding-name-fields label {
    display: grid;
    gap: 0.35rem;
}

/*
 * Accent swatches: real radio inputs (native keyboard/radiogroup semantics
 * and a clearly indicated :checked state for free) visually reduced to a
 * colour dot + Czech label. The dot colours are named classes, not inline
 * style="" -- this CMS's CSP (style-src 'self', no unsafe-inline; see
 * marie_send_cms_security_headers()) would silently drop an inline colour.
 */
.cms-branding-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

/*
 * min-width is a floor, not a cap -- the two longest preset labels
 * ("Oranžová", "Červená") still grow a little past it to fit their own
 * text, the rest (including "Vlastní") sit at the floor. Kept no larger
 * than that floor needs to be so all 8 swatches (7 presets + Vlastní)
 * comfortably share one row across the main editing column's width even
 * once the preview column (minmax(16rem, 20rem)) has taken its own space,
 * down to common ~1280px laptop viewports; they still wrap to more rows
 * automatically on genuinely narrow viewports (flex-wrap above).
 */
.cms-branding-swatch {
    position: relative;
    display: grid;
    min-width: 4rem;
    padding: 0.6rem;
    place-items: center;
    gap: 0.3rem;
    border: 1px solid var(--cms-border);
    border-radius: 0.5rem;
    background: var(--cms-white);
    cursor: pointer;
    font-size: 0.78rem;
    text-align: center;
}

.cms-branding-swatch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    opacity: 0;
}

.cms-branding-swatch:has(input:checked) {
    border-color: var(--cms-gold-dark);
    background: var(--cms-gold-light);
}

/* The real input is visually hidden (opacity:0) over the whole swatch, so
   the global :focus-visible rule would draw its ring around that invisible
   element -- redirected onto the visible swatch label instead. */
.cms-branding-swatch:has(input:focus-visible) {
    outline: 3px solid rgba(var(--cms-gold-rgb), 0.32);
    outline-offset: 2px;
}

.cms-branding-swatch-dot {
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid var(--cms-white);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--cms-border);
}

/* Literal preset hex values, inspected from the reference CMS's own
   BrandingResolver palette (dat-cms/core/BrandingResolver.php) -- not
   guessed -- so "Zlatá"/"Modrá"/etc. here match that CMS exactly. */
.cms-branding-swatch-gold .cms-branding-swatch-dot { background: #9a6b22; }
.cms-branding-swatch-purple .cms-branding-swatch-dot { background: #7553a6; }
.cms-branding-swatch-blue .cms-branding-swatch-dot { background: #3569a8; }
.cms-branding-swatch-green .cms-branding-swatch-dot { background: #34765a; }
.cms-branding-swatch-orange .cms-branding-swatch-dot { background: #b76025; }
.cms-branding-swatch-red .cms-branding-swatch-dot { background: #a64646; }
.cms-branding-swatch-gray .cms-branding-swatch-dot { background: #59616d; }
.cms-branding-swatch-dot-custom {
    background: linear-gradient(135deg, #7553a6, #3569a8, #34765a, #b76025, #a64646);
}

.cms-branding-color-field {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.cms-branding-color-field input[type="text"] {
    flex: 1 1 auto;
}

.cms-branding-color-field input[type="color"] {
    width: 3rem;
    min-height: 3rem;
    padding: 0.25rem;
}

/*
 * The reusable "current image + remove + replace" control (shared by the
 * light/dark logo cards, favicon card, and the login background's own
 * optional image -- see marie_cms_branding_asset_control_html()). A compact
 * bounded row, not a wrapper card of its own: these elements are direct
 * children of the one .cms-branding-card they belong to.
 */
.cms-branding-asset-current {
    display: flex;
    gap: 1rem;
    align-items: center;
    min-width: 0;
}

/*
 * Bounded to a fixed footprint with object-fit: contain, so the aspect
 * ratio is preserved and the thumbnail never grows to dominate the card --
 * light/dark modifiers give a light-surface logo a light backdrop (and a
 * dark-surface logo a dark one) so neither vanishes against the card's own
 * white background; the favicon modifier is smaller still, matching its
 * own compact ~64px icon presentation (requirement: roughly 64-96px).
 */
.cms-branding-asset-thumb {
    display: block;
    flex: 0 0 auto;
    width: 6rem;
    height: 6rem;
    object-fit: contain;
    border: 1px solid var(--cms-border);
    border-radius: 0.35rem;
}

.cms-branding-asset-thumb-light {
    background: var(--cms-cream);
}

.cms-branding-asset-thumb-dark {
    background: var(--cms-charcoal-soft);
}

.cms-branding-asset-thumb-favicon {
    width: 4.5rem;
    height: 4.5rem;
    background: var(--cms-cream);
}

.cms-branding-asset-status {
    min-width: 0;
}

.cms-branding-asset-status strong {
    display: block;
}

.cms-branding-asset-remove,
.cms-branding-upload-label {
    display: block;
}

/*
 * Requirement: normal control height, never stretched into a tall blank
 * box. width: 100% (useful inside the card's own column) but height: auto
 * with a normal control min-height, not textarea-like sizing, and
 * align-self: start so a grid ancestor's default item stretch can never
 * inflate it -- this is the actual native file-picker control's own
 * height, nothing more.
 */
.cms-branding-file-input {
    width: 100%;
    height: auto;
    min-height: 2.625rem;
    align-self: start;
}

/*
 * grid-area comes from .cms-branding-grid-area-preview (a plain modifier,
 * consistent with every other card), kept separate from the sticky
 * positioning here. Sticky, not a hard-coded margin-top/pixel offset: its
 * static position is already the "preview" area's own top (aligned with
 * the accent card by the grid-template-areas above), so it never moves
 * upward before scrolling and never needs a magic number tied to any
 * card's content height -- it just holds that position through the rows it
 * spans, then resumes normal flow once its area's bottom (after favicon)
 * scrolls past.
 */
.cms-branding-preview {
    position: sticky;
    top: 1rem;
}

.cms-branding-grid-area-preview {
    grid-area: preview;
}

.cms-branding-preview-sidebar {
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--cms-white);
    background: var(--cms-charcoal-soft);
    border-radius: 0.75rem;
}

.cms-branding-preview-brand {
    display: flex;
    margin-bottom: 1rem;
    gap: 0.6rem;
    align-items: center;
}

.cms-branding-preview-brand .cms-brand-mark {
    width: 2rem;
    height: 2rem;
    margin: 0;
    font-size: 1.1rem;
}

/* Decoupled from the "M" fallback square above -- same reasoning as
   .cms-auth-identity/.cms-brand: a real uploaded wordmark logo must keep
   its own aspect ratio, scaled to this compact preview box. */
.cms-branding-preview-brand .cms-brand-mark-image {
    flex-shrink: 0;
    width: auto;
    max-width: 5rem;
    height: auto;
    max-height: 1.75rem;
}

.cms-branding-preview-brand small {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.65rem;
}

.cms-branding-preview-nav {
    display: grid;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.cms-branding-preview-nav span {
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
}

.cms-branding-preview-nav span.is-active {
    color: var(--cms-charcoal);
    background: var(--cms-gold);
}

/* Confirmed-dark custom accents flip to light text -- see the matching
   classList.toggle() in assets/cms.js. Absent (light/default accent) keeps
   the dark text above, already readable on any light colour. */
.cms-branding-preview-nav span.is-active.cms-branding-preview-on-dark {
    color: var(--cms-white);
}

/* Same translucent-over-tint composition as the real .cms-auth-page/
   .cms-auth-card now (both above use var(--cms-charcoal-soft)/var(--cms-gold)
   already, so only this one still needed updating to stay a true preview). */
.cms-branding-preview-login {
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-lg);
    box-shadow: var(--cms-shadow);
    text-align: center;
}

.cms-branding-preview-login .cms-brand-mark {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 0.75rem;
    font-size: 1.1rem;
}

.cms-branding-preview-login .cms-brand-mark-image {
    width: auto;
    max-width: 8rem;
    height: auto;
    max-height: 2.25rem;
    margin: 0 auto 0.75rem;
}

.cms-branding-preview-eyebrow {
    margin-bottom: 0.35rem;
    color: var(--cms-gold-dark);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cms-branding-preview-login h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.cms-branding-preview-login p {
    margin: 0 0 0.75rem;
    color: var(--cms-muted);
    font-size: 0.8rem;
}

.cms-branding-preview-login button {
    padding: 0.5rem 1rem;
    color: #211b12;
    background: var(--cms-gold);
    border: 0;
    border-radius: 0.35rem;
    font-weight: 700;
}

.cms-branding-preview-login button.cms-branding-preview-on-dark {
    color: var(--cms-white);
}

@media (max-width: 64rem) {
    /* Single column, and the named areas revert to plain source order
       (company, accent, preview, background, logo-light, logo-dark,
       favicon -- see marie-admin/branding.php) instead of the two-column
       shape above, so "Náhled" lands naturally right after the accent
       card, with no overlap or leftover narrow column. */
    .cms-branding-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: none;
    }

    /* Explicit auto-placement, not left to fall back on an unmatched named
       area -- each card just takes the next row in DOM order. */
    .cms-branding-grid-area-company,
    .cms-branding-grid-area-accent,
    .cms-branding-grid-area-preview,
    .cms-branding-grid-area-background,
    .cms-branding-grid-area-logo-light,
    .cms-branding-grid-area-logo-dark,
    .cms-branding-grid-area-favicon {
        grid-area: auto;
    }

    .cms-branding-preview {
        position: static;
    }
}

@media (max-width: 52rem) {
    .cms-dashboard-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cms-notification-panel-body {
        position: fixed;
        top: 4.5rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

@media (max-width: 36rem) {
    .cms-dashboard-summary {
        grid-template-columns: 1fr;
    }

    .cms-branding-name-fields {
        grid-template-columns: 1fr;
    }
}

.cms-account-shell {
    max-width: 62rem;
}

.cms-eet-settings {
    max-width: 62rem;
}

.cms-eet-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.cms-eet-settings-grid > .cms-panel {
    min-width: 0;
    margin: 0;
}

.cms-eet-settings .cms-form {
    gap: 0.75rem;
}

.cms-eet-settings .cms-help {
    margin-block: 0;
}

.cms-eet-settings-details {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.cms-eet-settings-details dt {
    font-weight: 700;
}

.cms-eet-settings-details dd {
    margin: 0.2rem 0 0;
    overflow-wrap: anywhere;
}

@media (max-width: 56rem) {
    .cms-eet-settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cms-account-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
    color: var(--cms-muted);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.cms-account-back:hover {
    color: var(--cms-charcoal);
    text-decoration: underline;
}

.cms-account-heading {
    margin: 0.55rem 0 1.15rem;
}

.cms-account-heading h1 {
    margin: 0;
}

.cms-account-heading p {
    margin: 0.5rem 0 0;
    color: var(--cms-muted);
}

.cms-account-tabs {
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--cms-border);
}

.cms-account-tabs a,
.cms-account-tabs a[aria-current="page"] {
    padding: 0.65rem 0 0.6rem;
    color: var(--cms-muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 700;
}

.cms-account-tabs a:hover,
.cms-account-tabs a[aria-current="page"] {
    color: var(--cms-gold-dark);
}

.cms-account-tabs a[aria-current="page"] {
    border-bottom-color: currentColor;
}

.cms-account-password-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(15rem, 1fr);
    gap: 1rem;
    align-items: start;
}

.cms-account-panel {
    min-width: 0;
    margin: 0;
    padding: clamp(1rem, 2vw, 1.5rem);
}

.cms-account-password-form {
    gap: 1rem;
}

.cms-account-field {
    display: grid;
    gap: 0.4rem;
}

.cms-account-field [data-password-strength-meter] {
    margin: 0.1rem 0 0;
}

.cms-account-save {
    justify-content: flex-end;
    padding-top: 0.875rem;
    border-top: 1px solid var(--cms-border);
}

.cms-account-rules h2,
.cms-account-device h2 {
    margin: 0;
    font-size: 1rem;
}

.cms-account-rules ul {
    display: grid;
    gap: 0.4rem;
    margin: 0.65rem 0 0;
    padding-inline-start: 1.15rem;
    color: var(--cms-muted);
    font-size: 0.875rem;
}

.cms-account-rules li::marker {
    color: var(--cms-gold-dark);
}

.cms-account-rules p {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--cms-border);
    font-size: 0.875rem;
}

.cms-account-devices {
    padding: 0;
}

.cms-account-device-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cms-account-device {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem clamp(1rem, 2vw, 1.5rem);
}

.cms-account-device + .cms-account-device {
    border-top: 1px solid var(--cms-border);
}

.cms-account-device-info {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cms-account-device-info p {
    margin: 0.45rem 0 0;
    font-size: 0.875rem;
}

.cms-account-device-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.cms-account-device-action {
    flex: 0 0 auto;
    margin: 0;
}

.cms-account-device-action button:hover {
    background: #fae9e7;
}

.cms-account-empty {
    margin: 0;
    padding: 1.3rem;
}

@media (max-width: 63rem) {
    .cms-account-password-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 36rem) {
    .cms-account-save button {
        width: 100%;
    }

    .cms-account-device {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }
}

/*
 * Client-side password strength feedback -- UX only. The server
 * independently enforces the full policy (marie_password_validation_errors())
 * on every submit via marie_change_own_password()/
 * marie_apply_forced_password_change(), so a manipulated request can never
 * bypass validation through this meter; see assets/cms.js.
 */
[data-password-strength-meter] {
    display: grid;
    gap: 0.3rem;
    margin: -0.3rem 0 0.3rem;
}

[data-password-strength-meter]:empty {
    display: none;
}

.cms-password-strength-bar {
    height: 0.35rem;
    overflow: hidden;
    background: var(--cms-border);
    border-radius: 999px;
}

.cms-password-strength-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.15s ease, background-color 0.15s ease;
}

.cms-password-strength-fill-0 { width: 20%; background: var(--cms-error); }
.cms-password-strength-fill-1 { width: 40%; background: var(--cms-error); }
.cms-password-strength-fill-2 { width: 60%; background: var(--cms-gold-dark); }
.cms-password-strength-fill-3 { width: 80%; background: var(--cms-gold); }
.cms-password-strength-fill-4 { width: 100%; background: #2f7a4d; }

.cms-password-strength-label {
    color: var(--cms-muted);
    font-size: 0.75rem;
}

.cms-one-time-secret {
    padding: 0.85rem 1rem;
    background: var(--cms-gold-light);
    border: 1px solid var(--cms-gold-dark);
    border-radius: 0.5rem;
}

.cms-one-time-secret code {
    display: inline-block;
    margin: 0.35rem 0;
    padding: 0.4rem 0.6rem;
    overflow-wrap: anywhere;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: 0.35rem;
    font-size: 1rem;
    user-select: all;
}

/*
 * Accommodation Ceny tab only (marie-admin/prices.php, route cms.prices) --
 * opt-in, page-scoped, the same .cms-main-bounding precedent as every other
 * accommodation sub-page above (.cms-accommodation-images-page,
 * .cms-accommodation-amenities-page). This page used to render all five
 * catalogue resources' price editors on one page (a scrollable stack of
 * five <details> sections, one per resource) regardless of which one was
 * selected -- now scoped server-side to exactly one resource per request,
 * same as the other accommodation sub-pages; this bound just keeps its
 * (now much shorter) content from stretching edge-to-edge at a wide
 * desktop viewport.
 */
.cms-accommodation-prices-page .cms-main {
    width: min(100%, 56rem);
}

/*
 * Standard/base price: one compact row -- a normal-width label, a narrow
 * numeric field with its currency/unit visible right beside it, and a Save
 * button aligned with the field instead of a full-width stretched input
 * (the shared .cms-form-grid this used to rely on stretches every field to
 * its full grid column).
 */
.cms-accommodation-prices-page .cms-price-standard-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
}

/*
 * Shared right-side action column, reused unchanged by the standard-price
 * form's Save button, every existing seasonal row's Save+Deactivate pair,
 * and the new-seasonal-price row's Create button. A fixed flex-basis (never
 * "auto") is the whole point: an auto-sized action area shrinks to its own
 * button/label text, so its LEFT edge would drift row to row (one button
 * vs. two, "Uložit ..." vs. "Přidat ...", active vs. inactive). Pinned to a
 * constant width and pushed flush to the end of its flex row with
 * margin-left: auto instead, its left edge is always
 * (row width - this fixed width) -- identical on every row because
 * .cms-price-standard-form and every .cms-seasonal-fields row share the
 * same available width inside this page's .cms-panel, independent of
 * seasonal-row count, button/status text length, or active/inactive state.
 * Buttons stack vertically inside it (existing rows have two); a single
 * button (standard form, new row) is simply the only child.
 */
.cms-accommodation-prices-page .cms-price-actions-column {
    flex: 0 0 12rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: auto;
}

.cms-accommodation-prices-page .cms-price-actions-column .cms-button {
    width: 100%;
}

.cms-accommodation-prices-page .cms-price-standard-field {
    display: grid;
    gap: 0.35rem;
}

.cms-accommodation-prices-page .cms-price-standard-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cms-accommodation-prices-page .cms-price-standard-input-group input {
    width: 9rem;
}

.cms-accommodation-prices-page .cms-price-currency {
    color: var(--cms-muted);
    white-space: nowrap;
}

/*
 * Seasonal price rows (both the existing rows above and the "Nová sezónní
 * cena" creation row rendered by marie_cms_render_new_seasonal_price_form()).
 * The row itself (.cms-seasonal-row/.cms-seasonal-create, a <form>) is left
 * in normal block flow -- it is NOT a grid -- so its non-field row-header
 * content (the Aktivní/Neaktivní status badge on an existing row, the "Nová
 * sezónní cena" heading on the create row) stacks ABOVE the fields as an
 * ordinary block-level child instead of occupying a grid column and pushing
 * every field rightward. Only the inner .cms-seasonal-fields wrapper -- a
 * sibling that comes after the badge/heading, containing just Od/Do/CZK/
 * Aktivní-checkbox/actions -- is the grid, and it uses the exact same
 * column template on both the existing rows and the create row, so every
 * row's fields share one left edge and one set of column widths. Every
 * label is still its own single-column grid (text row, then its own input
 * row), so every field's label and input top edges line up by construction,
 * the same alignment fix already used for accommodation-images.php's
 * Pořadí field. Deliberately does not touch the shared .cms-inline-form/
 * .cms-seasonal-row/.cms-check-row/.cms-delete-confirmation* rules
 * themselves (also used, or usable, elsewhere) -- only overridden here,
 * page-scoped.
 *
 * .cms-seasonal-fields itself is now a two-item flex row, not the grid: the
 * grid moved one level down to .cms-seasonal-input-fields (Od/Do/CZK/
 * Aktivní-checkbox only), so the trailing .cms-price-actions-column can sit
 * beside it as a fixed-width sibling instead of being one more grid column
 * whose "auto" track width used to depend on that row's own button/label
 * content (see the shared .cms-price-actions-column comment above).
 */
.cms-accommodation-prices-page .cms-seasonal-row,
.cms-accommodation-prices-page .cms-seasonal-create {
    display: block;
}

.cms-accommodation-prices-page .cms-seasonal-row > .cms-status {
    display: inline-flex;
    margin-bottom: 0.75rem;
}

.cms-accommodation-prices-page .cms-seasonal-heading {
    display: block;
    margin-bottom: 0.5rem;
}

.cms-accommodation-prices-page .cms-seasonal-fields {
    display: flex;
    align-items: end;
    gap: 1rem;
}

.cms-accommodation-prices-page .cms-seasonal-input-fields {
    display: grid;
    grid-template-columns: minmax(8rem, 10rem) minmax(8rem, 10rem) minmax(6rem, 8rem) auto;
    align-items: end;
    gap: 0.75rem 1rem;
    flex: 1 1 auto;
    min-width: 0;
}

.cms-accommodation-prices-page .cms-seasonal-input-fields label {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.cms-accommodation-prices-page .cms-seasonal-input-fields input[type="date"],
.cms-accommodation-prices-page .cms-seasonal-input-fields input[type="number"] {
    width: 100%;
}

.cms-accommodation-prices-page .cms-seasonal-input-fields .cms-check-row {
    align-self: center;
}

/*
 * Destructive delete confirmation stays in normal document flow (never an
 * overlay floating on top of the next seasonal-price row), and -- now that
 * the row is a plain block, not a grid -- simply follows .cms-seasonal-
 * fields as its next block-level sibling inside the same row/card, keeping
 * it visually tied to the row it belongs to instead of floating loose. Same
 * page-scoped fix already applied to .cms-accommodation-images-page
 * .cms-delete-confirmation-panel above, reused here without touching the
 * shared, unscoped rule gallery.php and accommodation-images.php still
 * rely on.
 */
.cms-accommodation-prices-page .cms-delete-confirmation-panel {
    position: static;
    z-index: auto;
    right: auto;
    width: auto;
    max-width: 100%;
    margin-top: .5rem;
}

@media (max-width: 800px) {
    .cms-accommodation-prices-page .cms-seasonal-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .cms-accommodation-prices-page .cms-seasonal-input-fields {
        grid-template-columns: 1fr;
    }

    .cms-accommodation-prices-page .cms-price-standard-form {
        flex-direction: column;
        align-items: stretch;
    }

    .cms-accommodation-prices-page .cms-price-standard-input-group input {
        width: 100%;
    }

    /*
     * The fixed 12rem action-column track only exists to guarantee a
     * shared desktop left edge; at this breakpoint every row is already
     * stacked into normal block flow (flex-direction: column above), so
     * the action column collapses back to full width like every other
     * field instead of staying pinned to a desktop-only fixed width.
     */
    .cms-accommodation-prices-page .cms-price-actions-column {
        flex-basis: auto;
        width: 100%;
        margin-left: 0;
    }
}

/*
 * Platby a doklady -> Přehled (marie-admin/payments.php) only: every rule
 * below is .cms-pay-* scoped. The shared .cms-dashboard-summary/-card and
 * .cms-detail-list base rules stay untouched (Nastavení keeps its tiles);
 * here they are toned like the dashboard KPIs (.cms-dash-kpi) and the Fio
 * card's cream tiles become compact white label/value rows.
 */
.cms-pay-section {
    margin-bottom: 1rem;
}

.cms-pay-stats {
    margin-bottom: 0.5rem;
    gap: 0.75rem;
}

.cms-pay-stat {
    --cms-pay-accent: #334155;
    --cms-pay-accent-soft: #e8edf3;
    padding: 0.85rem 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label icon"
        "value icon";
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    align-items: start;
    border-left: 3px solid var(--cms-pay-accent-soft);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
    transition: border-color 150ms, box-shadow 150ms;
}

.cms-pay-stat:hover {
    border-color: var(--cms-border-strong);
    border-left-color: var(--cms-pay-accent);
    box-shadow: var(--cms-shadow);
}

.cms-pay-stat:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
}

.cms-pay-stat > strong {
    grid-area: value;
    color: var(--cms-charcoal);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.cms-pay-stat > span:not(.cms-pay-stat-icon) {
    grid-area: label;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
}

.cms-pay-stat .cms-pay-stat-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    grid-area: icon;
    place-items: center;
    color: var(--cms-pay-accent);
    background: var(--cms-pay-accent-soft);
    border-radius: 0.55rem;
}

/* K vyřízení turns amber only while something is waiting. */
.cms-pay-stat-attention.is-highlighted {
    --cms-pay-accent: #6e4700;
    --cms-pay-accent-soft: #fff0c2;
    border-color: #dfb64f;
    border-left-color: #d49a1d;
    box-shadow: none;
}

.cms-pay-stat-auto {
    --cms-pay-accent: #12542f;
    --cms-pay-accent-soft: #d8f3e3;
}

.cms-pay-stat-manual {
    --cms-pay-accent: #0b3b75;
    --cms-pay-accent-soft: #e3eefc;
}

.cms-pay-stats-more {
    margin: 0;
    text-align: right;
    font-size: 0.85rem;
}

.cms-pay-link {
    color: var(--cms-gold-dark);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.cms-pay-link:hover {
    text-decoration: underline;
}

.cms-pay-bank {
    padding: 1rem 1.25rem;
}

.cms-pay-bank-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.cms-pay-bank-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.cms-pay-bank-header .cms-pay-link {
    margin-left: auto;
}

.cms-pay-bank .cms-pay-bank-note {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #334155;
    background: #f3f5f8;
    border-left: 3px solid #b6bfcc;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.cms-pay-bank .cms-pay-bank-note.is-warning {
    color: #6e4700;
    background: #fff7dc;
    border-left-color: #d49a1d;
}

.cms-pay-bank .cms-pay-bank-note.is-error {
    color: #7a2525;
    background: #fae9e7;
    border-left-color: var(--cms-error);
}

.cms-pay-bank .cms-pay-rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2rem;
}

.cms-pay-bank .cms-pay-rows div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    min-height: 2.6rem;
    padding: 0.45rem 0;
    background: none;
    border-bottom: 1px solid var(--cms-border);
    border-radius: 0;
}

.cms-pay-bank .cms-pay-rows dt {
    color: var(--cms-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: none;
}

.cms-pay-bank .cms-pay-rows dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The last sync error spans the full width, so the message is readable. */
.cms-pay-bank .cms-pay-rows .cms-pay-row-error {
    grid-column: 1 / -1;
    align-items: baseline;
}

.cms-pay-bank .cms-pay-rows .cms-pay-row-error dd {
    color: #7a2525;
    text-align: left;
}

.cms-pay-details {
    margin-top: 0.6rem;
}

.cms-pay-details > summary {
    display: inline-block;
    padding: 0.2rem 0;
    color: var(--cms-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
}

.cms-pay-details > summary:hover {
    color: var(--cms-charcoal);
}

.cms-pay-details > summary:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
    border-radius: 0.2rem;
}

.cms-pay-details[open] > summary {
    margin-bottom: 0.25rem;
}

.cms-pay-attention .cms-alert {
    margin-bottom: 0;
}

.cms-pay-empty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
}

.cms-pay-empty-icon {
    display: grid;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    color: #12542f;
    background: #d8f3e3;
    border-radius: 999px;
}

.cms-pay-empty-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.cms-pay-empty-text p {
    margin: 0;
    color: var(--cms-muted);
    font-size: 0.875rem;
}

.cms-pay-empty-text .cms-pay-empty-title {
    color: var(--cms-charcoal);
    font-size: 0.95rem;
    font-weight: 700;
}

@media (max-width: 52rem) {
    .cms-pay-bank .cms-pay-rows {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Two compact cards per row on phones; one only on very narrow screens. */
@media (max-width: 36rem) {
    .cms-pay-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cms-pay-stat {
        padding: 0.7rem 0.75rem;
        grid-template-areas:
            "label label"
            "value icon";
        align-items: end;
    }

    .cms-pay-stat .cms-pay-stat-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .cms-pay-stat > strong {
        font-size: 1.3rem;
    }

    .cms-pay-bank {
        padding: 0.9rem 1rem;
    }

    .cms-pay-bank-header .cms-pay-link {
        margin-left: 0;
        flex-basis: 100%;
    }
}

@media (max-width: 22rem) {
    .cms-pay-stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

/*
 * Platby a doklady -> Nastavení (marie-admin/payments-settings.php) only:
 * every rule is scoped to the page's body class. Same cards (.cms-panel),
 * tokens and Přehled status rows (.cms-pay-bank/.cms-pay-rows/
 * .cms-pay-details) as the redesigned Přehled; the forms follow the
 * existing .cms-reservation-form pattern (label above its control, two
 * minmax(0, 1fr) columns while the card is wide enough, container query
 * with a media-query fallback). No global form rule is changed.
 */
.cms-payments-settings-page .cms-pset-info {
    margin-bottom: 1rem;
    padding: 0.85rem 1.1rem;
    color: #334155;
    background: #f3f5f8;
    border: 1px solid var(--cms-border);
    border-left: 3px solid #b6bfcc;
    border-radius: var(--cms-radius);
    font-size: 0.875rem;
}

.cms-payments-settings-page .cms-pset-info h2 {
    margin: 0 0 0.3rem;
    color: var(--cms-charcoal);
    font-size: 0.9rem;
}

.cms-payments-settings-page .cms-pset-info p,
.cms-payments-settings-page .cms-pset-info ul {
    margin: 0;
}

.cms-payments-settings-page .cms-pset-info ul {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.35rem;
    padding-left: 1.1rem;
}

/* Platební údaje + Náhled side by side only when both genuinely fit. */
.cms-payments-settings-page .cms-pset-layout {
    container-type: inline-size;
}

@container (min-width: 66rem) {
    .cms-payments-settings-page .cms-pset-layout {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        gap: 0 1rem;
        align-items: start;
    }
}

.cms-payments-settings-page .cms-pset-card {
    container-type: inline-size;
}

.cms-payments-settings-page .cms-pset-card > h2 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
}

.cms-payments-settings-page .cms-pset-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.cms-payments-settings-page .cms-pset-card .cms-pset-card-lead {
    margin: 0 0 0.75rem;
}

.cms-payments-settings-page .cms-pset-card .cms-alert {
    margin-bottom: 0.75rem;
}

/* Forms: labels above controls, two equal columns, capped control widths. */
.cms-payments-settings-page .cms-pset-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
}

.cms-payments-settings-page .cms-pset-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    min-width: 0;
}

.cms-payments-settings-page .cms-pset-field > * {
    min-width: 0;
    max-width: 100%;
}

.cms-payments-settings-page .cms-pset-field p,
.cms-payments-settings-page .cms-pset-form > p {
    margin: 0;
}

.cms-payments-settings-page .cms-pset-field-wide,
.cms-payments-settings-page .cms-pset-actions,
.cms-payments-settings-page .cms-pset-form > p {
    grid-column: 1 / -1;
}

.cms-payments-settings-page .cms-pset-field input:not([type="checkbox"]),
.cms-payments-settings-page .cms-pset-field textarea {
    max-width: 30rem;
}

.cms-payments-settings-page .cms-pset-field-wide textarea {
    max-width: 46rem;
}

.cms-payments-settings-page .cms-pset-field-compact input:not([type="checkbox"]) {
    max-width: 11rem;
}

.cms-payments-settings-page .cms-pset-field .cms-check-row {
    min-height: 2.625rem;
}

.cms-payments-settings-page .cms-pset-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--cms-border);
}

/* API token: the input with its verification button directly beside it. */
.cms-payments-settings-page .cms-pset-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.cms-payments-settings-page .cms-pset-inline input {
    flex: 1 1 16rem;
    width: auto;
    max-width: 30rem;
}

/* Sub-sections inside a card (Synchronizace / Automatické párování, ...). */
.cms-payments-settings-page .cms-pset-subsection + .cms-pset-subsection {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cms-border);
}

/* No token yet: the connection form follows the status rows in Připojení Fio Bank. */
.cms-payments-settings-page .cms-pay-bank > .cms-pset-subsection {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--cms-border);
}

.cms-payments-settings-page .cms-pset-subsection > p {
    margin: 0 0 0.75rem;
    max-width: 46rem;
    font-size: 0.875rem;
}

.cms-payments-settings-page .cms-pset-subsection > .cms-form {
    max-width: 46rem;
}

/* Náhled: white label/value rows instead of the cream quote block. */
.cms-payments-settings-page .cms-pset-preview > p {
    margin: 0 0 0.75rem;
}

.cms-payments-settings-page .cms-pset-preview-list {
    display: grid;
    margin: 0 0 1rem;
    border-top: 1px solid var(--cms-border);
}

.cms-payments-settings-page .cms-pset-preview-list div {
    display: grid;
    grid-template-columns: minmax(7.5rem, 0.8fr) minmax(0, 1.2fr);
    gap: 0.25rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cms-border);
    font-size: 0.875rem;
}

.cms-payments-settings-page .cms-pset-preview-list dt {
    color: var(--cms-muted);
    font-weight: 600;
}

.cms-payments-settings-page .cms-pset-preview-list dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.cms-payments-settings-page .cms-pset-preview-list .cms-pset-preview-note dd {
    font-weight: 400;
}

.cms-payments-settings-page .cms-pset-preview .cms-pset-preview-subtitle {
    margin: 0 0 0.35rem;
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cms-payments-settings-page .cms-pset-preview-pending dd {
    color: var(--cms-muted);
    font-style: italic;
    font-weight: 400;
}

/* Nebezpečná zóna: a red accent, never a red background. */
.cms-payments-settings-page .cms-pset-danger {
    border-color: #e8c4c0;
    border-left: 3px solid var(--cms-error);
}

.cms-payments-settings-page .cms-pset-danger > h2 {
    color: var(--cms-error);
}

@container (max-width: 34rem) {
    .cms-payments-settings-page .cms-pset-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 36rem) {
    .cms-payments-settings-page .cms-pset-form,
    .cms-payments-settings-page .cms-pset-preview-list div {
        grid-template-columns: minmax(0, 1fr);
    }

    .cms-payments-settings-page .cms-pset-inline .cms-form-actions,
    .cms-payments-settings-page .cms-pset-inline .cms-button {
        width: 100%;
    }

    .cms-payments-settings-page .cms-pset-field input:not([type="checkbox"]),
    .cms-payments-settings-page .cms-pset-inline input {
        max-width: none;
    }
}

/*
 * Booking.com calendars page (BOOKING-SYNC-REDESIGN): compact notice, four
 * status cards, collapsed "Pokročilé nastavení" and one collapsible card per
 * room. Every rule is scoped to body.cms-booking-sync-page, so no other
 * screen changes. No new font: the masked URL uses the page typography.
 */
.cms-booking-sync-page .cms-bsync-notice {
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    background: var(--cms-ivory);
    border: 1px solid var(--cms-border);
    border-left: 3px solid var(--cms-gold);
    border-radius: var(--cms-radius);
}

.cms-booking-sync-page .cms-bsync-notice h2 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.cms-booking-sync-page .cms-bsync-notice ul {
    display: grid;
    margin: 0;
    padding-left: 1.1rem;
    gap: 0.2rem;
    font-size: 0.875rem;
}

.cms-booking-sync-page .cms-bsync-more {
    margin-top: 0.6rem;
    font-size: 0.85rem;
}

.cms-booking-sync-page .cms-bsync-more summary,
.cms-booking-sync-page .cms-bsync-reveal summary {
    width: max-content;
    max-width: 100%;
    color: var(--cms-gold-dark);
    font-weight: 700;
    cursor: pointer;
}

.cms-booking-sync-page .cms-bsync-more p {
    margin: 0.5rem 0 0;
}

.cms-booking-sync-page .cms-bsync-stats {
    display: grid;
    margin-bottom: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.cms-booking-sync-page .cms-bsync-stat {
    display: grid;
    min-width: 0;
    padding: 0.8rem 1rem;
    align-content: start;
    gap: 0.15rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-left: 3px solid var(--cms-border-strong);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
}

.cms-booking-sync-page .cms-bsync-stat.is-on {
    border-left-color: #12542f;
}

.cms-booking-sync-page .cms-bsync-stat.is-warning {
    background: #fffaf0;
    border-left-color: #b26a00;
}

.cms-booking-sync-page .cms-bsync-stat-label {
    color: var(--cms-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.cms-booking-sync-page .cms-bsync-stat strong {
    color: var(--cms-charcoal);
    font-size: 1.15rem;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.cms-booking-sync-page .cms-bsync-stat-note {
    color: var(--cms-muted);
    font-size: 0.78rem;
}

.cms-booking-sync-page .cms-bsync-advanced > summary {
    font-weight: 700;
    cursor: pointer;
}

.cms-booking-sync-page .cms-bsync-advanced-body {
    display: grid;
    margin-top: 0.9rem;
    gap: 0.9rem;
}

.cms-booking-sync-page .cms-bsync-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

/* "Pokročilé nastavení" technical facts reuse the plain room facts
   (.cms-bsync-facts-plain + -pair: two columns, one on phones); long key
   names may wrap. A hairline then separates them from the controls. */
.cms-booking-sync-page .cms-bsync-advanced-facts dt {
    overflow-wrap: anywhere;
}

.cms-booking-sync-page .cms-bsync-advanced-facts + .cms-help {
    margin: 0.35rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--cms-border);
}

.cms-booking-sync-page .cms-bsync-rooms h2 {
    margin: 1.25rem 0 0.6rem;
    font-size: 1rem;
}

.cms-booking-sync-page .cms-bsync-room {
    min-width: 0;
    margin-bottom: 0.5rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
}

.cms-booking-sync-page .cms-bsync-room[open] {
    border-color: var(--cms-border-strong);
}

.cms-booking-sync-page .cms-bsync-room-summary {
    display: grid;
    padding: 0.7rem 1rem;
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) minmax(0, 0.6fr) auto;
    align-items: center;
    gap: 0.5rem 1rem;
    list-style: none;
    cursor: pointer;
}

.cms-booking-sync-page .cms-bsync-room-summary::-webkit-details-marker {
    display: none;
}

.cms-booking-sync-page .cms-bsync-room-summary:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
    border-radius: var(--cms-radius);
}

.cms-booking-sync-page .cms-bsync-room[open] > .cms-bsync-room-summary {
    border-bottom: 1px solid var(--cms-border);
}

.cms-booking-sync-page .cms-bsync-room-name {
    display: grid;
    min-width: 0;
}

.cms-booking-sync-page .cms-bsync-room-name strong {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.cms-booking-sync-page .cms-bsync-room-name small,
.cms-booking-sync-page .cms-bsync-room-fact small {
    color: var(--cms-muted);
    font-size: 0.75rem;
}

.cms-booking-sync-page .cms-bsync-room-fact {
    display: grid;
    min-width: 0;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.cms-booking-sync-page .cms-bsync-room-toggle {
    padding: 0.3rem 0.75rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border-strong);
    border-radius: var(--cms-radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.cms-booking-sync-page .cms-bsync-room-summary:hover .cms-bsync-room-toggle,
.cms-booking-sync-page .cms-bsync-room[open] .cms-bsync-room-toggle {
    background: var(--cms-ivory);
    border-color: var(--cms-gold-dark);
}

.cms-booking-sync-page .cms-bsync-room-body {
    display: grid;
    min-width: 0;
    padding: 1rem;
    gap: 1rem;
}

.cms-booking-sync-page .cms-bsync-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.cms-booking-sync-page .cms-bsync-section {
    min-width: 0;
}

.cms-booking-sync-page .cms-bsync-columns .cms-bsync-section {
    padding: 0.9rem 1rem;
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
}

.cms-booking-sync-page .cms-bsync-section h3 {
    margin: 0 0 0.6rem;
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cms-booking-sync-page .cms-bsync-section > * + * {
    margin-top: 0.6rem;
}

.cms-booking-sync-page .cms-bsync-facts {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0 1rem;
}

.cms-booking-sync-page .cms-bsync-facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
}

.cms-booking-sync-page .cms-bsync-facts dt {
    color: var(--cms-muted);
    font-size: 0.75rem;
}

/* "Stav synchronizace": plain white rows with hairline separators instead of
   the generic cream .cms-detail-list tiles (those stay for every other list).
   Reused verbatim by Online rezervace (.cms-public-booking-page: Stav and
   Ochrana proti zneužití) -- one shared pattern, not a second design. */
.cms-booking-sync-page .cms-bsync-facts-plain, .cms-public-booking-page .cms-bsync-facts-plain {
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: 0 1.5rem;
}

.cms-booking-sync-page .cms-bsync-facts-plain div, .cms-public-booking-page .cms-bsync-facts-plain div {
    display: grid;
    padding: 0.55rem 0;
    align-content: start;
    gap: 0.15rem;
    background: transparent;
    border-bottom: 1px solid var(--cms-border);
    border-radius: 0;
}

.cms-booking-sync-page .cms-bsync-facts-plain dt, .cms-public-booking-page .cms-bsync-facts-plain dt {
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.cms-booking-sync-page .cms-bsync-facts-plain dd, .cms-public-booking-page .cms-bsync-facts-plain dd {
    margin: 0;
    color: var(--cms-charcoal);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cms-booking-sync-page .cms-bsync-facts-plain dd .cms-status, .cms-public-booking-page .cms-bsync-facts-plain dd .cms-status {
    vertical-align: baseline;
}

/* Export token facts: generation and fingerprint always side by side, stacked on phones. */
.cms-booking-sync-page .cms-bsync-facts-pair, .cms-public-booking-page .cms-bsync-facts-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 30rem) {
    .cms-booking-sync-page .cms-bsync-facts-pair, .cms-public-booking-page .cms-bsync-facts-pair {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cms-booking-sync-page .cms-bsync-form {
    display: grid;
    gap: 0.4rem;
}

.cms-booking-sync-page .cms-bsync-form > input,
.cms-booking-sync-page .cms-bsync-form > select,
.cms-booking-sync-page .cms-bsync-reveal input {
    width: 100%;
    min-width: 0;
}

.cms-booking-sync-page .cms-bsync-form > label,
.cms-booking-sync-page .cms-bsync-form-label {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.cms-booking-sync-page .cms-bsync-masked {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0.4rem 0.6rem;
    overflow-wrap: anywhere;
    color: var(--cms-charcoal);
    background: var(--cms-ivory);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius-sm);
    font-family: inherit;
    font-size: 0.82rem;
}

.cms-booking-sync-page .cms-bsync-copy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cms-booking-sync-page .cms-bsync-copy .cms-bsync-masked {
    flex: 1 1 auto;
}

.cms-booking-sync-page .cms-bsync-copy .cms-button {
    flex: none;
}

.cms-booking-sync-page .cms-bsync-reveal {
    display: grid;
    gap: 0.35rem;
    font-size: 0.82rem;
}

.cms-booking-sync-page .cms-bsync-export-state {
    margin: 0;
}

.cms-booking-sync-page .cms-bsync-rotate {
    align-items: center;
}

@media (max-width: 72rem) {
    .cms-booking-sync-page .cms-bsync-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 64rem) {
    .cms-booking-sync-page .cms-bsync-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 52rem) {
    /* Room card: name + state, then the two facts, then the toggle. */
    .cms-booking-sync-page .cms-bsync-room-summary {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "name state"
            "success count"
            "toggle toggle";
    }

    .cms-booking-sync-page .cms-bsync-room-name { grid-area: name; }
    .cms-booking-sync-page .cms-bsync-room-summary > .cms-status { grid-area: state; justify-self: end; }
    .cms-booking-sync-page .cms-bsync-room-fact:nth-of-type(3) { grid-area: success; }
    .cms-booking-sync-page .cms-bsync-room-fact:nth-of-type(4) { grid-area: count; }

    .cms-booking-sync-page .cms-bsync-room-toggle {
        grid-area: toggle;
        text-align: center;
    }

    .cms-booking-sync-page .cms-bsync-room-body {
        padding: 0.85rem;
    }
}

@media (max-width: 30rem) {
    .cms-booking-sync-page .cms-bsync-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .cms-booking-sync-page .cms-bsync-copy {
        flex-wrap: wrap;
    }
}


/*
 * Nová / Upravit rezervaci z Booking.com (BOOKING-COM-RESERVATION-LAYOUT,
 * marie-admin/booking-com-reservation.php): the same page layout as Nová
 * blokace termínu (manual-block.php) -- the default .cms-main (left-aligned,
 * standard padding and cap) and one full-width .cms-panel holding the form;
 * the white info panels follow underneath, stacked. No .cms-main override
 * and no side column. Every rule is scoped to body.cms-bcom-reservation-page;
 * the shared .cms-reservation-form grid (also the Direct form) keeps its own
 * two field columns and one column on phones.
 */
.cms-bcom-reservation-page .cms-bcom-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.cms-bcom-reservation-page .cms-bcom-layout > .cms-panel {
    max-width: none;
    margin-bottom: 0;
    min-width: 0;
}

.cms-bcom-reservation-page .cms-reservation-form {
    row-gap: 1.1rem;
}

.cms-bcom-reservation-page [data-booking-com-form] h2 {
    margin: 0.75rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--cms-border);
    font-size: 1.05rem;
}

.cms-bcom-reservation-page [data-booking-com-form] h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.cms-bcom-reservation-page .cms-bcom-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    min-width: 0;
}

.cms-bcom-reservation-page .cms-bcom-info {
    min-width: 0;
    padding: 1.25rem;
    background: var(--cms-white);
    border: 1px solid var(--cms-border);
    border-radius: var(--cms-radius);
    box-shadow: var(--cms-shadow-sm);
}

.cms-bcom-reservation-page .cms-bcom-info h2 {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    margin: 0 0 0.85rem;
    font-size: 1rem;
    line-height: 1.35;
}

.cms-bcom-reservation-page .cms-bcom-info-icon {
    flex: none;
    color: #2f6fb5;
}

.cms-bcom-reservation-page .cms-bcom-info-item + .cms-bcom-info-item {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--cms-border);
}

.cms-bcom-reservation-page .cms-bcom-info h3 {
    margin: 0 0 0.3rem;
    color: var(--cms-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cms-bcom-reservation-page .cms-bcom-info p {
    margin: 0;
    color: var(--cms-charcoal);
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (max-width: 36rem) {
    .cms-bcom-reservation-page .cms-bcom-info {
        padding: 1rem;
    }
}

/*
 * Platby a doklady -> Bankovní pohyby (marie-admin/bank-transactions.php)
 * only: every rule is scoped to the page's body class. Presentation only;
 * the shared .cms-reservation-filters grid, .cms-status badges and the
 * reservation tables' mobile card collapse stay untouched -- the collapse
 * below copies that pattern for .cms-bank-table instead of widening the
 * shared selector list.
 */

/* Filters: Filtrovat at its natural width plus a quiet reset link, in the
   third column of the second row (the shared rule spans the full row). */
.cms-bank-transactions-page .cms-bank-filters .cms-bank-filter-actions {
    grid-column: auto;
    gap: 0.25rem 1rem;
}

.cms-bank-transactions-page .cms-bank-reset {
    display: inline-flex;
    min-height: 2.625rem;
    align-items: center;
    color: var(--cms-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--cms-border-strong);
    text-underline-offset: 0.2em;
}

.cms-bank-transactions-page .cms-bank-reset:hover {
    color: var(--cms-charcoal);
    text-decoration-color: currentColor;
}

.cms-bank-transactions-page .cms-bank-reset:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
    border-radius: 0.2rem;
}

/* Status badges: same pill as .cms-status, semantic tones (list only). */
.cms-bank-transactions-page .cms-bank-status-attention {
    color: #6e4700;
    background: #fff0c2;
}

.cms-bank-transactions-page .cms-bank-status-auto {
    color: #12542f;
    background: #d8f3e3;
}

.cms-bank-transactions-page .cms-bank-status-manual {
    color: #0b3b75;
    background: #e3eefc;
}

.cms-bank-transactions-page .cms-bank-status-ignored,
.cms-bank-transactions-page .cms-bank-status-other {
    color: #334155;
    background: #e8edf3;
}

.cms-bank-transactions-page .cms-bank-table td[data-label="Stav"] .cms-status + .cms-status {
    margin-top: 0.25rem;
}

/* Důvod / předběžné posouzení: quieter, full text, natural wrapping. */
.cms-bank-transactions-page .cms-bank-table .cms-bank-reason {
    min-width: 12rem;
    color: var(--cms-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.cms-bank-transactions-page .cms-bank-table .cms-bank-reason .cms-help {
    font-size: inherit;
}

/* Detail: a quiet neutral secondary button, gold only on hover/focus. */
.cms-bank-transactions-page .cms-bank-table .cms-bank-detail-link {
    min-height: 2.4rem;
    padding: 0.45rem 0.85rem;
    color: var(--cms-charcoal);
    background: var(--cms-white);
    border: 1px solid var(--cms-border-strong);
    white-space: nowrap;
}

.cms-bank-transactions-page .cms-bank-table .cms-bank-detail-link:hover {
    background: var(--cms-ivory);
    border-color: var(--cms-gold-dark);
}

.cms-bank-transactions-page .cms-bank-table .cms-bank-detail-link:focus-visible {
    outline: 2px solid var(--cms-focus);
    outline-offset: 2px;
}

/* Empty states: a neutral block inside the list card, never a success banner. */
.cms-bank-transactions-page .cms-bank-empty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 1rem 0 0.25rem;
}

.cms-bank-transactions-page .cms-bank-empty-icon {
    display: grid;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    color: #334155;
    background: #e8edf3;
    border-radius: 999px;
}

.cms-bank-transactions-page .cms-bank-empty-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.cms-bank-transactions-page .cms-bank-empty-text p {
    margin: 0;
    font-size: 0.875rem;
}

.cms-bank-transactions-page .cms-bank-empty-text .cms-bank-empty-title {
    color: var(--cms-charcoal);
    font-size: 0.95rem;
    font-weight: 700;
}

/* Mobile: each transaction becomes a card built from the same table cells
   (their data-label attributes), no JavaScript and no second markup. */
@media (max-width: 52rem) {
    .cms-bank-transactions-page .cms-bank-table,
    .cms-bank-transactions-page .cms-bank-table tbody,
    .cms-bank-transactions-page .cms-bank-table tr,
    .cms-bank-transactions-page .cms-bank-table td {
        display: block;
        width: 100%;
    }

    .cms-bank-transactions-page .cms-bank-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .cms-bank-transactions-page .cms-bank-table tr {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid var(--cms-border);
        border-radius: 0.5rem;
        background: var(--cms-white);
    }

    .cms-bank-transactions-page .cms-bank-table td {
        padding: 0.55rem 0;
        border-bottom: 1px solid var(--cms-border);
        overflow-wrap: break-word;
        white-space: normal;
    }

    .cms-bank-transactions-page .cms-bank-table td:last-child {
        border-bottom: 0;
    }

    .cms-bank-transactions-page .cms-bank-table td::before {
        display: block;
        margin-bottom: 0.2rem;
        color: var(--cms-muted);
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .cms-bank-transactions-page .cms-bank-table .cms-bank-reason {
        min-width: 0;
    }

    .cms-bank-transactions-page .cms-bank-table .cms-bank-detail-link {
        width: 100%;
        min-height: 2.75rem;
    }
}
