/* Shared styles for pages moved to the Sites 1.5 design.
   Everything is scoped under .ui-page, so pages that haven't been restyled are unaffected. */
.ui-page {
    --ui-grey-1000: #141821;
    --ui-grey-700: #4B5261;
    --ui-grey-600: #8C929D;
    --ui-grey-500: #B5BBC5;
    --ui-grey-400: #DADEE5;
    --ui-grey-300: #F1F2F6;
    --ui-white: #FFFFFF;
    --ui-bg: #F5F6F8;
    --ui-shadow-card: 0 0 2px rgba(20, 24, 33, 0.05), 0 1px 4px rgba(20, 24, 33, 0.04);
    --ui-radius-lg: 18px;
    --ui-radius-pill: 999px;
    --ui-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-family: var(--ui-font);
    color: var(--ui-grey-1000);
    -webkit-font-smoothing: antialiased;
}

/* ---------- page header ---------- */
.ui-page .ui-page-header {
    margin: 6px 0 22px;
}

.ui-page .ui-page-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ui-page .ui-page-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--ui-grey-600);
}

/* ---------- card ---------- */
.ui-page .ui-card {
    background: var(--ui-white);
    border: 1px solid var(--ui-grey-300);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-card);
    overflow: hidden;
}

.ui-page .ui-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--ui-grey-600);
}

/* ---------- table inside a card ---------- */
.ui-page .ui-table-wrap {
    overflow-x: auto;
}

.ui-page .ui-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 14px;
}

.ui-page .ui-table th {
    padding: 14px 18px;
    border-bottom: 1px solid var(--ui-grey-300);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ui-grey-600);
    text-align: left;
    white-space: nowrap;
}

/* Opt-in sticky table header (.ui-card-sticky-table on the card), e.g. Build Queue.
   overflow: hidden/auto on the card/wrap would make the header stick inside them rather than the window, so on
   desktop the card uses overflow: clip (still rounds the corners, but isn't a scroll container) and the wrap
   doesn't scroll. Below 900px the table keeps its horizontal scroll and the header just scrolls with it. */
@media (min-width: 901px) {
    .ui-page .ui-card-sticky-table {
        overflow: clip;
    }

    .ui-page .ui-card-sticky-table .ui-table-wrap {
        overflow-x: visible;
    }

    .ui-page .ui-card-sticky-table .ui-table th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--ui-white);
        /* Collapsed borders don't travel with sticky cells, so draw the divider as a shadow instead */
        border-bottom: none;
        box-shadow: inset 0 -1px 0 var(--ui-grey-300);
    }
}

.ui-page .ui-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--ui-grey-300);
    vertical-align: middle;
    color: var(--ui-grey-700);
    white-space: nowrap;
}

.ui-page .ui-table tbody tr:last-child td {
    border-bottom: none;
}

.ui-page .ui-table tbody tr:hover td {
    background: var(--ui-bg);
}

.ui-page .ui-cell-primary {
    font-weight: 600;
    color: var(--ui-grey-1000);
}

.ui-page .ui-cell-meta {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--ui-grey-600);
}

.ui-page .ui-muted {
    color: var(--ui-grey-500);
}

/* ---------- pills ---------- */
.ui-page .ui-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--ui-radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    background: var(--ui-grey-300);
    color: var(--ui-grey-700);
}

.ui-page .ui-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.ui-page .ui-pill-blue { background: #E6F1FD; color: #3E7FC6; }
.ui-page .ui-pill-orange { background: #FFF3E5; color: #D78522; }
.ui-page .ui-pill-green { background: #EFFBF3; color: #28B866; }
.ui-page .ui-pill-red { background: #FFF0F0; color: #D94343; }

/* Pill carrying a build error in its tooltip */
.ui-page .ui-pill-has-error { cursor: help; }
/* Tooltips render on <body>, outside .ui-page, so values are literal; they mirror the Sites listing tooltip. */
.ui-error-tooltip {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.ui-error-tooltip .tooltip-inner {
    background: #141821;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    padding: 6px 10px;
    max-width: 420px;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}
.ui-error-tooltip.top .tooltip-arrow { border-top-color: #141821; }
.ui-error-tooltip.bottom .tooltip-arrow { border-bottom-color: #141821; }
.ui-error-tooltip.left .tooltip-arrow { border-left-color: #141821; }
.ui-error-tooltip.right .tooltip-arrow { border-right-color: #141821; }

/* Small outline tag, e.g. Preview / Live */
.ui-page .ui-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border: 1px solid var(--ui-grey-400);
    border-radius: var(--ui-radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: var(--ui-grey-600);
    vertical-align: middle;
}

/* ---------- header with actions on the right ---------- */
.ui-page .ui-page-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

/* ---------- inputs ---------- */
.ui-page .ui-input {
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--ui-grey-400);
    border-radius: 12px;
    background: var(--ui-white);
    font-size: 14px;
    color: var(--ui-grey-1000);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ui-page .ui-input:focus {
    border-color: var(--ui-grey-1000);
    box-shadow: 0 0 0 3px rgba(20, 24, 33, 0.14);
    outline: none;
}

.ui-page .ui-search {
    position: relative;
}

.ui-page .ui-search .ui-input {
    width: 260px;
    max-width: 100%;
    padding-left: 36px;
}

.ui-page .ui-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ui-grey-600);
    pointer-events: none;
}

/* ---------- buttons ---------- */
.ui-page .ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border: 1.5px solid var(--ui-grey-400);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-white);
    color: var(--ui-grey-1000);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ui-page .ui-btn:hover,
.ui-page .ui-btn:focus {
    border-color: var(--ui-grey-1000);
    outline: none;
}

.ui-page .ui-btn-primary {
    border-color: var(--ui-grey-1000);
    background: var(--ui-grey-1000);
    color: var(--ui-white);
}

.ui-page .ui-btn-primary:hover,
.ui-page .ui-btn-primary:focus {
    background: #2A2F3D;
    border-color: #2A2F3D;
    color: var(--ui-white);
}

.ui-page .ui-btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.ui-page .ui-btn-danger:hover,
.ui-page .ui-btn-danger:focus {
    border-color: #D94343;
    color: #D94343;
}

/* ---------- toolbar row at the top of a card ---------- */
.ui-page .ui-card-toolbar {
    display: flex;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ui-grey-300);
    background: var(--ui-bg);
}

.ui-page .ui-card-toolbar .ui-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- simple list of rows inside a card ---------- */
.ui-page .ui-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--ui-grey-300);
}

.ui-page .ui-list-row:last-child {
    border-bottom: none;
}

.ui-page .ui-list-row:hover {
    background: var(--ui-bg);
}

.ui-page .ui-list-row-main {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    color: var(--ui-grey-1000);
    overflow-wrap: anywhere;
}

.ui-page .ui-list-row-main .ui-input {
    width: 100%;
}

.ui-page .ui-list-row-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.ui-page .ui-list-row-actions form {
    margin: 0;
}

/* ---------- card with a heading and padded body ---------- */
.ui-page .ui-card + .ui-card {
    margin-top: 20px;
}

.ui-page .ui-card-header {
    padding: 18px 24px 0;
}

/* Card header with a button on the right */
.ui-page .ui-card-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ui-page .ui-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-grey-1000);
}

.ui-page .ui-card-header p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ui-grey-600);
}

.ui-page .ui-card-body {
    padding: 20px 24px 24px;
}

/* ---------- forms ---------- */
.ui-page .ui-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

@media (max-width: 767px) {
    .ui-page .ui-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ui-page .ui-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ui-page .ui-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-grey-700);
}

.ui-page .ui-field .ui-input {
    width: 100%;
}

.ui-page select.ui-input {
    padding-right: 36px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238C929D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* "Please select..." is a disabled first option, not a real placeholder — grey it like input placeholders
   while it's the current value, but keep the real choices in the open list dark. */
.ui-page select:has(> option:disabled:checked) {
    color: var(--ui-grey-600);
}

.ui-page select:has(> option:disabled:checked) option:not(:disabled) {
    color: var(--ui-grey-1000);
}

/* Customisable select (Chrome/Edge 135+): style the open list. Mirrors the Sites listing's Search & Filters
   (.si-field-pill in Views/Site/Index.cshtml) so every dropdown opens the same way. Other browsers keep the native list. */
@supports (appearance: base-select) {
    .ui-page select.ui-input:not([multiple]):not([size]),
    .ui-page select.ui-input:not([multiple]):not([size])::picker(select) {
        appearance: base-select;
    }

    /* Keeps the selected value vertically centred in the closed box. */
    .ui-page select.ui-input:not([multiple]):not([size]) {
        display: flex;
        align-items: center;
        cursor: pointer;
    }

    .ui-page select.ui-input::picker-icon {
        display: none; /* the box draws its own chevron (background-image above) */
    }

    .ui-page select.ui-input::picker(select) {
        margin-top: 6px;
        padding: 6px;
        min-width: anchor-size(width);
        border: 1px solid var(--ui-grey-400);
        border-radius: 12px;
        background: var(--ui-white);
        box-shadow: 0 0 2px rgba(20, 24, 33, 0.06), 0 2px 8px rgba(20, 24, 33, 0.07);
    }

    .ui-page select.ui-input option {
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        color: var(--ui-grey-1000);
    }

    .ui-page select.ui-input option:hover,
    .ui-page select.ui-input option:focus-visible {
        background: var(--ui-grey-300);
        outline: none;
    }

    .ui-page select.ui-input option:checked {
        font-weight: 600;
    }

    .ui-page select.ui-input option::checkmark {
        display: none;
    }

    .ui-page select.ui-input option:disabled {
        color: var(--ui-grey-600);
    }
}

.ui-page .ui-input.input-validation-error {
    border-color: #D94343;
}

.ui-page .ui-field-error {
    font-size: 12.5px;
    color: #D94343;
}

.ui-page .ui-field-error:empty {
    display: none;
}

/* ---------- sticky action bar under a form ---------- */
.ui-page .ui-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 24px;
    background: var(--ui-white);
    border: 1px solid var(--ui-grey-300);
    border-radius: var(--ui-radius-lg);
    box-shadow: 0 -2px 12px rgba(20, 24, 33, 0.06);
}

/* On mobile the pinned bar eats a lot of a small screen and puts Save/Create in view before the form's been filled
   in, so there it just sits at the end of the form. 900px matches the app shell's mobile breakpoint. */
@media (max-width: 900px) {
    .ui-page .ui-action-bar {
        position: static;
        box-shadow: var(--ui-shadow-card);
    }
}

.ui-page .ui-action-bar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- destructive actions ---------- */
.ui-page .ui-danger-zone {
    margin-top: 20px;
    border-color: #F6D3D3;
}

.ui-page .ui-danger-zone .ui-card-header h3 {
    color: #D94343;
}

.ui-page .ui-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--ui-grey-300);
}

.ui-page .ui-danger-row:first-child {
    padding-top: 0;
    border-top: none;
}

.ui-page .ui-danger-row:last-child {
    padding-bottom: 0;
}

.ui-page .ui-danger-row strong {
    display: block;
    font-size: 14px;
    color: var(--ui-grey-1000);
}

.ui-page .ui-danger-row span {
    font-size: 13px;
    color: var(--ui-grey-600);
}

.ui-page .ui-btn-danger-outline {
    border-color: #F0B4B4;
    color: #D94343;
}

.ui-page .ui-btn-danger-outline:hover,
.ui-page .ui-btn-danger-outline:focus {
    border-color: #D94343;
    background: #FFF0F0;
    color: #D94343;
}

/* Key/value details shown under a page title */
.ui-page .ui-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--ui-grey-600);
}

.ui-page .ui-meta-list strong {
    font-weight: 600;
    color: var(--ui-grey-1000);
    overflow-wrap: anywhere;
}

/* ---------- filter card (search forms) ---------- */
.ui-page .ui-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px 18px;
}

.ui-page .ui-filter-grid .ui-field-wide {
    grid-column: span 2;
}

@media (max-width: 767px) {
    .ui-page .ui-filter-grid .ui-field-wide {
        grid-column: auto;
    }
}

/* Cards holding pop-ups (date pickers, Froala editor popups such as the icon picker) must not clip them. */
.ui-page .ui-card.ui-card-overflow,
.ui-page .ui-card:has(.fr-box) {
    overflow: visible;
}

.ui-page .ui-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* Lets the Bootstrap datetimepicker position its pop-up next to the input. */
.ui-page .ui-date {
    position: relative;
}

.ui-page .ui-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ui-page .ui-date-range > .ui-date {
    flex: 1 1 0;
    min-width: 0;
}

.ui-page .ui-date-range > span {
    font-size: 13px;
    color: var(--ui-grey-600);
}

.ui-page .ui-date .ui-input {
    width: 100%;
}

.ui-page .bootstrap-datetimepicker-widget {
    font-family: var(--ui-font);
    border-radius: 12px;
}

.ui-page .bootstrap-datetimepicker-widget table td.active,
.ui-page .bootstrap-datetimepicker-widget table td.active:hover,
.ui-page .bootstrap-datetimepicker-widget table td span.active {
    background-color: var(--ui-grey-1000);
    color: var(--ui-white);
}

.ui-page .bootstrap-datetimepicker-widget table td.today:before {
    border-bottom-color: var(--ui-grey-1000);
}

/* ---------- checkboxes ---------- */
.ui-page .ui-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: inherit;
    cursor: pointer;
}

.ui-page .ui-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ui-grey-1000);
    cursor: pointer;
}

.ui-page .ui-truncate {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.ui-page .ui-btn:disabled,
.ui-page .ui-btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

.ui-page .ui-action-bar-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-grey-700);
}

/* ---------- PagedList pager ---------- */
.ui-page .pager-container {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.ui-page .pager-container .pagination {
    margin: 0;
}

.ui-page .pager-container .pagination > li > a,
.ui-page .pager-container .pagination > li > span {
    margin: 0 3px;
    border: 1px solid var(--ui-grey-300);
    border-radius: 8px;
    background: var(--ui-white);
    color: var(--ui-grey-700);
    font-size: 13px;
}

.ui-page .pager-container .pagination > .active > span,
.ui-page .pager-container .pagination > .active > a {
    border-color: var(--ui-grey-1000);
    background: var(--ui-grey-1000);
    color: var(--ui-white);
}

.ui-page .pager-container .pagination > li > a:hover {
    border-color: var(--ui-grey-300);
    background: var(--ui-grey-300);
    color: var(--ui-grey-1000);
}

/* ---------- alerts ---------- */
.ui-page .ui-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid var(--ui-grey-400);
    border-radius: 12px;
    background: var(--ui-white);
    font-size: 14px;
    color: var(--ui-grey-1000);
}

.ui-page .ui-alert-danger {
    border-color: #F6D3D3;
    background: #FFF0F0;
    color: #A82E2E;
}

.ui-page .ui-alert-success {
    border-color: #C7EED6;
    background: #EFFBF3;
    color: #1E7A47;
}

/* Validation summary: hidden while it has nothing to show. */
.ui-page .ui-alert.validation-summary-valid {
    display: none;
}

.ui-page .ui-alert ul {
    margin: 0;
    padding-left: 18px;
}

.ui-page .ui-table td.ui-cell-actions {
    text-align: right;
}

/* Opt-in wrapping for a cell that can hold long text (td cells are nowrap by default). overflow-wrap: anywhere
   also breaks long unspaced strings, so the column shrinks to fit instead of forcing a horizontal scroll. */
.ui-page .ui-table td.ui-cell-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 200px;
}

.ui-page .ui-cell-actions .ui-list-row-actions {
    justify-content: flex-end;
}

/* ---------- per-site header (_SiteHeader) ---------- */
.ui-page.ui-site-header-wrap {
    margin: 6px 0 24px;
}

.ui-page .ui-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-grey-600);
    text-decoration: none;
}

.ui-page .ui-back-link:hover,
.ui-page .ui-back-link:focus {
    color: var(--ui-grey-1000);
    text-decoration: none;
}

.ui-page .ui-site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.ui-page .ui-site-header-main {
    flex: 1 1 420px;
    min-width: 0;
}

.ui-page .ui-site-header-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.ui-page .ui-site-header-title h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.ui-page .ui-input-sm {
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.ui-page select.ui-input-sm {
    padding-right: 32px;
    background-position: right 12px center;
}

.ui-page .ui-site-header .ui-meta-list a {
    font-weight: 600;
}

.ui-page .ui-site-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- tabs (segmented control) ---------- */
.ui-page .ui-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 22px;
    padding: 5px;
    border-radius: 14px;
    /* A shade darker than the muted page background so the track shows on grey and white pages. */
    background: #E9EBF0;
}

.ui-page .ui-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ui-grey-700);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}


.ui-page .ui-tab:hover,
.ui-page .ui-tab:focus {
    background: rgba(255, 255, 255, 0.6);
    color: var(--ui-grey-1000);
    text-decoration: none;
    outline: none;
}

.ui-page .ui-tab-active,
.ui-page .ui-tab-active:hover,
.ui-page .ui-tab-active:focus {
    background: var(--ui-white);
    color: var(--ui-grey-1000);
    box-shadow: 0 1px 3px rgba(20, 24, 33, 0.10), 0 0 0 1px rgba(20, 24, 33, 0.04);
}

/* ---------- card toolbar with a title on the left ---------- */
.ui-page .ui-card-toolbar-split {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: var(--ui-white);
}

.ui-page .ui-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-grey-1000);
}

.ui-page .ui-card-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ui-grey-600);
}

/* ---------- on/off switch ---------- */
.ui-page .ui-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}

.ui-page .ui-switch input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.ui-page .ui-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--ui-grey-400);
    transition: background-color .15s ease;
}

.ui-page .ui-switch-track::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ui-white);
    box-shadow: 0 1px 2px rgba(20, 24, 33, 0.2);
    transition: transform .15s ease;
}

.ui-page .ui-switch input:checked + .ui-switch-track {
    background: #28B866;
}

.ui-page .ui-switch input:checked + .ui-switch-track::before {
    transform: translateX(16px);
}

.ui-page .ui-switch input:focus-visible + .ui-switch-track {
    box-shadow: 0 0 0 3px rgba(20, 24, 33, 0.14);
}

/* ---------- tables of inputs (e.g. redirects) ---------- */
.ui-page .ui-table-inputs td {
    padding-top: 8px;
    padding-bottom: 8px;
    /* Top-aligned so the inputs line up even when a cell has extra text underneath (e.g. an email id). */
    vertical-align: top;
}

/* Centre the smaller buttons and checkbox lists against the 40px inputs. */
.ui-page .ui-table-inputs td.ui-cell-actions {
    padding-top: 12px;
}

.ui-page .ui-table-inputs .ui-check-list {
    padding-top: 2px;
}

.ui-page .ui-table-inputs .ui-input {
    width: 100%;
    min-width: 160px;
}

.ui-page .ui-table-inputs .ui-cell-status {
    width: 110px;
}

.ui-page .ui-table-inputs .ui-cell-status .ui-input {
    min-width: 80px;
}

.ui-page .ui-table-inputs td.ui-cell-actions {
    width: 1%;
}

/* ---------- textarea ---------- */
.ui-page .ui-textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 160px;
    padding: 12px 14px;
    font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}

.ui-page .ui-card-header code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--ui-grey-300);
    color: var(--ui-grey-1000);
    font-size: 12px;
}

/* ---------- add-to-list row and list of paths (Invalidate Cache) ---------- */
.ui-page .ui-inline-add {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ui-page .ui-inline-add .ui-input {
    flex: 1 1 320px;
    min-width: 0;
}

.ui-page .ui-path-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ui-page .ui-path-list:empty {
    display: none;
}

.ui-page .ui-path-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 6px 4px 12px;
    border: 1px solid var(--ui-grey-400);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-bg);
}

.ui-page .ui-path-item code {
    padding: 0;
    background: none;
    color: var(--ui-grey-1000);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.ui-page .ui-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ui-grey-600);
    font-size: 12px;
    cursor: pointer;
}

.ui-page .ui-icon-btn:hover,
.ui-page .ui-icon-btn:focus {
    background: #FFF0F0;
    color: #D94343;
    outline: none;
}

.ui-page .ui-empty-compact {
    padding: 20px 0 4px;
    text-align: left;
}

/* ---------- form helpers (Search Filters) ---------- */
.ui-page .ui-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 991px) {
    .ui-page .ui-form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ui-page .ui-form-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ui-page .ui-field-hint {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ui-grey-600);
    /* Hints from Autopromotor can be long unspaced lists (e.g. 0|500|1000|...), which would otherwise run off the card. */
    overflow-wrap: anywhere;
}

.ui-page .ui-field > .ui-switch {
    align-self: flex-start;
    margin-top: 4px;
}

.ui-page .ui-action-bar-hint {
    font-size: 13px;
    color: var(--ui-grey-600);
}

/* ---------- enquiry emails ---------- */
.ui-page .ui-check-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    white-space: normal;
}

.ui-page .ui-card-footnote {
    padding: 12px 18px;
    border-top: 1px solid var(--ui-grey-300);
    font-size: 13px;
    color: var(--ui-grey-600);
}

/* ---------- error page (Shared/Error.cshtml) ---------- */
.ui-page .ui-error-card {
    max-width: 760px;
    margin: 32px auto 0;
}

.ui-page .ui-error-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ui-page .ui-error-heading h2 {
    margin: 2px 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ui-page .ui-error-heading p {
    margin: 0;
    font-size: 14px;
    color: var(--ui-grey-600);
}

.ui-page .ui-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FFF0F0;
    color: #D94343;
    font-size: 20px;
}

.ui-page .ui-error-details {
    margin: 20px 0 0 60px;
    font-size: 14px;
    color: var(--ui-grey-1000);
    overflow-wrap: anywhere;
}

.ui-page .ui-error-details:empty {
    display: none;
}

.ui-page .ui-error-details ul {
    margin: 0;
    padding: 12px 16px 12px 32px;
    border: 1px solid #F6D3D3;
    border-radius: 12px;
    background: #FFF0F0;
    color: #A82E2E;
}

.ui-page .ui-error-details li + li {
    margin-top: 4px;
}

.ui-page .ui-error-reference {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ui-grey-600);
}

.ui-page .ui-error-reference code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--ui-grey-300);
    color: var(--ui-grey-1000);
    font-size: 12px;
}

.ui-page .ui-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 0 60px;
}

@media (max-width: 575px) {
    .ui-page .ui-error-details,
    .ui-page .ui-error-actions {
        margin-left: 0;
    }
}

/* ---------- confirm dialog (wwwroot/js/app-ui.js) ---------- */
.ui-page.ui-confirm {
    width: min(440px, calc(100vw - 32px));
    padding: 28px 28px 24px;
    border: none;
    border-radius: var(--ui-radius-lg);
    background: var(--ui-white);
    box-shadow: 0 24px 64px rgba(20, 24, 33, 0.22);
    text-align: center;
}

.ui-page.ui-confirm::backdrop {
    background: rgba(20, 24, 33, 0.45);
}

.ui-page.ui-confirm form {
    margin: 0;
}

.ui-page .ui-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #FFF0F0;
    color: #D94343;
    font-size: 20px;
}

.ui-page.ui-confirm-primary .ui-confirm-icon {
    background: #FFF3E5;
    color: #D78522;
}

.ui-page .ui-confirm-title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ui-grey-1000);
}

.ui-page .ui-confirm-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ui-grey-700);
    overflow-wrap: anywhere;
}

.ui-page .ui-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.ui-page .ui-confirm-actions .ui-btn {
    min-width: 120px;
}

.ui-page .ui-btn-danger-solid {
    border-color: #D94343;
    background: #D94343;
    color: var(--ui-white);
}

.ui-page .ui-btn-danger-solid:hover,
.ui-page .ui-btn-danger-solid:focus {
    border-color: #B83636;
    background: #B83636;
    color: var(--ui-white);
}

/* ---------- vehicle field mapping editor (FieldMappings/Edit) ---------- */
.ui-page .fm-editor .ui-card + .ui-card {
    margin-top: 20px;
}

.ui-page .fm-editor + .ui-card,
.ui-page #rawPanel {
    margin-top: 0;
}

.ui-page .fm-table .fm-cell-value .ui-input {
    font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
}

/* Drag handle + dragged row, matching the Site Sections table */
.ui-page .fm-table .fm-handle-col,
.ui-page .fm-table .fm-handle {
    width: 1%;
    padding-right: 0;
}

.ui-page .fm-table .fm-handle {
    color: var(--ui-grey-500);
    font-size: 16px;
    cursor: grab;
    vertical-align: middle;
}

.ui-page .fm-table .fm-handle:hover {
    color: var(--ui-grey-1000);
}

.ui-page .fm-table tr.ui-sortable-helper {
    display: table;
    background: var(--ui-white);
    box-shadow: 0 6px 20px rgba(20, 24, 33, 0.14);
}

.ui-page .fm-table tr.ui-sortable-helper td {
    background: var(--ui-white);
}

.ui-page .fm-table tr.ui-sortable-helper .fm-handle {
    cursor: grabbing;
}

.ui-page .fm-table tr.ui-sortable-placeholder td {
    background: var(--ui-bg);
    border: 1px dashed var(--ui-grey-400);
}

.ui-page .fm-table .fm-cell-switch {
    width: 1%;
    padding-top: 16px;
}

.ui-page .fm-row-actions {
    display: flex;
    gap: 2px;
    justify-content: flex-end;
}

.ui-page .ui-icon-btn:disabled {
    opacity: .3;
    cursor: default;
    background: transparent;
    color: var(--ui-grey-600);
}

.ui-page .ui-icon-btn:not(.ui-icon-btn-danger):not(:disabled):hover,
.ui-page .ui-icon-btn:not(.ui-icon-btn-danger):not(:disabled):focus {
    background: var(--ui-grey-300);
    color: var(--ui-grey-1000);
}

.ui-page .ui-page-subtitle .ui-pill {
    margin-right: 4px;
}

/* ---------- site sections ---------- */
.ui-page .ui-field-inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.ui-page .ui-field-inline .ui-input {
    min-width: 240px;
}

.ui-page .ui-field-inline .ui-label {
    white-space: nowrap;
}

/* jQuery UI sortable auto-scrolls the nearest auto/scroll ancestor. overflow-x: auto on the wrap makes that the
   wrap (overflow-y computes to auto too), which never scrolls vertically, so dragging near the window edge did
   nothing. The table is only four narrow columns, so it doesn't need the horizontal scroll; let the window scroll. */
.ui-page .sections-table-wrap {
    overflow: visible;
}

.ui-page .sections-table .section-handle-col,
.ui-page .sections-table .section-handle {
    width: 1%;
    padding-right: 0;
}

.ui-page .sections-table .section-handle {
    color: var(--ui-grey-500);
    font-size: 16px;
    cursor: grab;
}

.ui-page .sections-table .section-handle:hover {
    color: var(--ui-grey-1000);
}

/* Row being dragged (jQuery UI sortable). */
.ui-page .sections-table tr.ui-sortable-helper {
    display: table;
    background: var(--ui-white);
    box-shadow: 0 6px 20px rgba(20, 24, 33, 0.14);
}

.ui-page .sections-table tr.ui-sortable-helper td {
    background: var(--ui-white);
}

.ui-page .ui-card-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--ui-grey-300);
    background: var(--ui-bg);
}

/* ---------- Autopromotor dealer details (Shared/_Dealer.cshtml) ---------- */
.ui-page.ui-dealer {
    font-size: 14px;
}

.ui-page .ui-dealer-summary {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.ui-page .ui-dealer-logo {
    flex: 0 0 auto;
    max-width: 160px;
    max-height: 72px;
    object-fit: contain;
    padding: 8px;
    border: 1px solid var(--ui-grey-300);
    border-radius: 12px;
    background: var(--ui-white);
}

/* Label/value pairs laid out in a grid. */
.ui-page .ui-details {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px 24px;
    margin: 0;
}

.ui-page .ui-details dt {
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--ui-grey-600);
}

.ui-page .ui-details dd {
    margin: 0;
    color: var(--ui-grey-1000);
    overflow-wrap: anywhere;
}

.ui-page .ui-details .ui-details-wide {
    grid-column: 1 / -1;
}

.ui-page .ui-details code {
    padding: 0;
    background: none;
    color: var(--ui-grey-1000);
}

.ui-page .ui-dealer-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ui-grey-1000);
}

.ui-page .ui-dealer-heading span {
    padding: 1px 8px;
    border-radius: var(--ui-radius-pill);
    background: var(--ui-grey-300);
    font-size: 12px;
    color: var(--ui-grey-700);
}

.ui-page .ui-dealer-branch {
    border: 1px solid var(--ui-grey-300);
    border-radius: 12px;
    background: var(--ui-white);
}

.ui-page .ui-dealer-branch + .ui-dealer-branch {
    margin-top: 8px;
}

.ui-page .ui-dealer-branch summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}

.ui-page .ui-dealer-branch summary::-webkit-details-marker {
    display: none;
}

.ui-page .ui-dealer-branch summary:hover {
    background: var(--ui-bg);
    border-radius: 12px;
}

.ui-page .ui-dealer-branch-name {
    font-weight: 600;
    color: var(--ui-grey-1000);
}

.ui-page .ui-dealer-branch .ui-tag {
    margin-left: 0;
}

.ui-page .ui-dealer-branch-email {
    color: var(--ui-grey-600);
    overflow-wrap: anywhere;
}

.ui-page .ui-dealer-chevron {
    margin-left: auto;
    color: var(--ui-grey-500);
    transition: transform .15s ease;
}

.ui-page .ui-dealer-branch[open] .ui-dealer-chevron {
    transform: rotate(180deg);
}

.ui-page .ui-dealer-branch-body {
    padding: 4px 16px 16px;
    border-top: 1px solid var(--ui-grey-300);
}

.ui-page .ui-dealer-branch-body > .ui-details {
    margin-top: 12px;
}

.ui-page .ui-dealer-department {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--ui-grey-400);
}

.ui-page .ui-dealer-department h5 {
    margin: 0 0 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ui-grey-1000);
}

.ui-page .ui-dealer-department-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px 24px;
}

.ui-page .ui-dealer-department ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-page .ui-dealer-department li .ui-muted {
    margin-right: 6px;
}

.ui-page .ui-dealer-label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-grey-600);
}

.ui-page .ui-dealer-special {
    margin-top: 10px;
}

.ui-page .ui-dealer-hours {
    border-collapse: collapse;
}

.ui-page .ui-dealer-hours th,
.ui-page .ui-dealer-hours td {
    padding: 2px 16px 2px 0;
    font-size: 13.5px;
    vertical-align: top;
}

.ui-page .ui-dealer-hours th {
    font-weight: 600;
    color: var(--ui-grey-700);
}

@media (max-width: 575px) {
    .ui-page .ui-dealer-summary {
        flex-direction: column;
    }
}

/* ---------- themes ---------- */
.ui-page .ui-form-grid .ui-field-wide {
    grid-column: 1 / -1;
}

.ui-page .ui-check-list-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 14px;
}

/* Table row / card a post just added or changed; the class is removed after a moment. */
.ui-page .ui-highlight,
.ui-page .ui-highlight > td {
    background-color: #FFF8E1;
    transition: background-color .4s ease;
}

.ui-page .ui-card-toolbar .ui-inline-add {
    flex: 0 1 420px;
}

.ui-page .ui-card-toolbar .ui-inline-add .ui-input {
    flex: 1 1 200px;
}

/* ---------- Site menu editor (SiteMenu/Create, Edit) ---------- */
.ui-page .menu-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.ui-page .menu-editor-layout .ui-card + .ui-card {
    margin-top: 0;
}

@media (max-width: 991px) {
    .ui-page .menu-editor-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ui-page .menu-item-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ui-page .menu-input-row {
    display: flex;
    gap: 8px;
}

.ui-page .menu-input-row .ui-input {
    flex: 1 1 auto;
    min-width: 0;
}

.ui-page .menu-input-row .iconpicker {
    flex: 0 0 auto;
    padding: 0 14px;
}

.ui-page .menu-file-input {
    height: auto;
    padding: 8px 14px;
}

.ui-page .menu-image-preview:not(:empty) {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.ui-page .menu-image-preview img {
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid var(--ui-grey-300);
}

.ui-page .menu-item-form .validation {
    font-size: 12.5px;
    color: #D94343;
}

/* jquery-menu-editor renders Bootstrap 3 list-group items and btn-xs buttons; restyle them in place. */
.ui-page .menu-editor-list,
.ui-page .menu-editor-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-page .menu-editor-list ul {
    margin-top: 8px;
    padding-left: 24px;
}

.ui-page .menu-editor-list .list-group-item,
.menu-editor-drag .list-group-item {
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--ui-grey-400);
    border-radius: 12px;
    background: var(--ui-white);
    cursor: grab;
}

.ui-page .menu-editor-list .list-group-item > div,
.menu-editor-drag .list-group-item > div {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0 !important;
    font-weight: 600;
}

.ui-page .menu-editor-list .txt,
.menu-editor-drag .txt {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-page .menu-editor-list .btn-group,
.menu-editor-drag .btn-group {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    float: none !important;
}

.ui-page .menu-editor-list .btn-group > .btn,
.menu-editor-drag .btn-group > .btn {
    float: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border: 1.5px solid var(--ui-grey-400);
    border-radius: var(--ui-radius-pill) !important;
    background: var(--ui-white);
    color: var(--ui-grey-1000);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.ui-page .menu-editor-list .btn-group > .btn:hover,
.menu-editor-drag .btn-group > .btn:hover {
    border-color: var(--ui-grey-1000);
}

.ui-page .menu-editor-list .btn-group > .btnRemove:hover,
.menu-editor-drag .btn-group > .btnRemove:hover {
    border-color: #D94343;
    color: #D94343;
}

.ui-page .menu-editor-list .sortableListsOpener,
.menu-editor-drag .sortableListsOpener {
    margin-right: 4px;
}

.ui-page .menu-editor-list:empty::before {
    content: "No items yet. Add one using the form.";
    display: block;
    padding: 32px 16px;
    text-align: center;
    color: var(--ui-grey-600);
}

.menu-editor-drag,
.menu-editor-drag ul {
    list-style: none;
}

/* The library sizes the dragged item from its content width, so keep padding/border outside it. */
.menu-editor-drag .list-group-item {
    box-sizing: content-box;
    box-shadow: 0 6px 20px rgba(20, 24, 33, 0.14);
    cursor: grabbing;
}

.ui-page .menu-editor-list .menu-editor-opener,
.menu-editor-drag .menu-editor-opener {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--ui-grey-400);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-white);
    color: var(--ui-grey-1000);
    font-size: 12px;
    cursor: pointer;
}

.ui-page .menu-editor-list .menu-editor-opener:hover {
    border-color: var(--ui-grey-1000);
}

/* Nesting by drag appends the toggle to the end of the row; keep it first. */
.ui-page .menu-editor-list .menu-editor-opener,
.menu-editor-drag .menu-editor-opener {
    order: -1;
}

/* sortableLists positions the item from viewport coordinates on mousedown but as position:absolute, so on a
   scrolled page it jumps up by the scroll amount until the mouse moves (it switches to fixed on move). */
.menu-editor-drag > li {
    position: fixed !important;
}

/* ---------- Site content editor (SiteContent/Create, Edit) ---------- */
.ui-page .content-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ui-page .content-editor .ui-card + .ui-card {
    margin-top: 0;
}

.ui-page #siteContentValues:empty,
.ui-page #error:empty {
    display: none;
}

.ui-page .content-editor-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ui-page .content-editor-name {
    max-width: 480px;
}

.ui-page .content-editor-script {
    height: auto;
    padding: 12px 14px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
}

/* One .content-field per value (SiteContent/_SiteContentValue). */
.ui-page .content-editor-values {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ui-page .content-field-short {
    max-width: 240px;
}

.ui-page .content-field .ui-input[readonly] {
    background: var(--ui-bg);
    color: var(--ui-grey-700);
}

.ui-page .content-field-add {
    display: flex;
    gap: 8px;
    max-width: 560px;
}

.ui-page .content-field-add .ui-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* List / image rows (server-rendered in _SiteContentValue, script-built in site-content-editor.js). */
.ui-page .content-row-list,
.ui-page .content-slide-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.ui-page .content-row-list {
    max-width: 720px;
}

.ui-page .content-row-list:empty,
.ui-page .content-slide-list:empty {
    display: none;
}

.ui-page .content-row-btn {
    flex: 0 0 auto;
    width: 32px;
    padding: 0;
}

/* The item text is a bare text node (it's the saved value), so it can't be styled directly; push the buttons right. */
.ui-page .content-list-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--ui-grey-400);
    border-radius: 12px;
    background: var(--ui-white);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.ui-page .content-list-row > .content-row-btn:first-of-type {
    margin-left: auto;
}

.ui-page .content-media-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--ui-grey-400);
    border-radius: 12px;
    background: var(--ui-white);
}

.ui-page .content-media-thumb {
    margin-right: 6px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--ui-bg);
    object-fit: cover;
}

.ui-page .content-media-link,
.ui-page .content-slide-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--ui-grey-700);
}

.ui-page .content-row-error {
    font-size: 12.5px;
    color: #D94343;
}

/* Slides: thumbnail, filename and buttons on the first line, fields full width below. Buttons have to stay direct
   children of the <li> (see _SlideshowContentRow), hence a grid rather than wrapper divs. */
.ui-page .content-slideshow {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ui-page .content-slide-list {
    gap: 12px;
}

.ui-page .content-slide-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 16px 6px;
    padding: 16px;
    border: 1px solid var(--ui-grey-400);
    border-radius: 14px;
    background: var(--ui-white);
}

.ui-page .content-slide-thumb {
    grid-column: 1;
    grid-row: 1;
    width: 96px;
    height: 72px;
    margin-right: 8px;
    border-radius: 10px;
    background: var(--ui-bg);
    object-fit: cover;
}

.ui-page .content-slide-title {
    grid-column: 2;
    grid-row: 1;
}

.ui-page .content-slide-row > .content-row-btn {
    grid-row: 1;
}

.ui-page .content-slide-fields {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.ui-page .content-file-input {
    height: auto;
    max-width: 560px;
    padding: 8px 14px;
}

.ui-page .content-colour {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
}

.ui-page .content-colour .input-group-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1.5px solid var(--ui-grey-400);
    border-radius: 12px;
    background: var(--ui-white);
    cursor: pointer;
}

.ui-page .content-colour .input-group-addon i {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

/* Collapsible panel inside a field card (slideshow). */
.ui-page .content-subpanel {
    border: 1px solid var(--ui-grey-400);
    border-radius: 14px;
    background: var(--ui-white);
}

.ui-page .content-subpanel .ui-card-toggle {
    padding: 14px 18px;
}

.ui-page .content-subpanel .ui-card-toggle-title {
    font-size: 14px;
}

.ui-page .content-subpanel-body {
    padding: 0 18px 18px;
}

/* Card whose header toggles a Bootstrap collapse body. */
.ui-page .ui-card-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 18px 24px;
    border: 0;
    background: none;
    text-align: left;
    color: var(--ui-grey-1000);
    cursor: pointer;
}

.ui-page .ui-card-toggle:focus-visible {
    outline: 2px solid var(--ui-grey-1000);
    outline-offset: -2px;
    border-radius: var(--ui-radius-lg);
}

.ui-page .ui-card-toggle-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.ui-page .ui-card-toggle-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--ui-grey-600);
}

.ui-page .ui-card-toggle .bi-chevron-down {
    flex: 0 0 auto;
    transition: transform .15s ease;
}

.ui-page .ui-card-toggle:not(.collapsed) .bi-chevron-down {
    transform: rotate(180deg);
}

.ui-page .ui-card-toggle + .collapse > .ui-card-body,
.ui-page .ui-card-toggle + .collapsing > .ui-card-body {
    padding-top: 0;
}

/* ---------- Bootstrap modal restyled with the redesign (#myLargeModal in _Layout) ---------- */
.ui-page.ui-modal {
    border: none;
    border-radius: var(--ui-radius-lg);
    background: var(--ui-white);
    box-shadow: 0 24px 64px rgba(20, 24, 33, 0.22);
}

.ui-page.ui-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 0;
    border-bottom: none;
}

.ui-page.ui-modal .modal-header::before,
.ui-page.ui-modal .modal-header::after {
    content: none;
}

.ui-page.ui-modal .modal-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ui-grey-1000);
}

.ui-page .ui-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--ui-grey-700);
    cursor: pointer;
}

.ui-page .ui-modal-close:hover,
.ui-page .ui-modal-close:focus-visible {
    background: var(--ui-grey-300);
    color: var(--ui-grey-1000);
    outline: none;
}

.ui-page.ui-modal .modal-body {
    padding: 20px 24px 24px;
}

.ui-page.ui-modal .modal-footer:empty {
    display: none;
}

/* ---------- Child content (SiteContent/_ChildContent, _ChildContentRow) ---------- */
.ui-page .child-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ui-page .child-content-add {
    display: flex;
    gap: 8px;
}

.ui-page .child-content-add .ui-input {
    flex: 1 1 auto;
    min-width: 0;
}

.ui-page .child-content-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ui-page .child-content-list:empty {
    display: none;
}

/* Name + buttons on the first row, preview text and options full width below. Buttons have to stay direct
   children of the <li> (see _ChildContent.cshtml), hence a grid rather than wrapper divs. */
.ui-page .child-content-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px 6px;
    padding: 14px 16px;
    border: 1px solid var(--ui-grey-400);
    border-radius: 14px;
    background: var(--ui-white);
}

.ui-page .child-content-name {
    grid-row: 1;
    grid-column: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.ui-page .child-content-btn {
    grid-row: 1;
    width: 32px;
    padding: 0;
}

.ui-page .child-content-row .ui-textarea,
.ui-page .child-content-options {
    grid-column: 1 / -1;
}

.ui-page .child-content-row .ui-textarea {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
}

.ui-page .child-content-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- site options ---------- */
/* Customisable dropdown: select shrinks so its Custom options / Reset buttons share the line. */
.ui-page .options-select-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ui-page .options-select-row .ui-input {
    flex: 1 1 160px;
    min-width: 0;
}

.ui-page .options-select-row .ui-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
