.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(51, 40, 43, 0.5);
    backdrop-filter: blur(2px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[hidden],
.ctx-menu[hidden],
.week-view[hidden] {
    display: none !important;
}

/* There is no reduced-motion block for the view switch any more: the switch
   does not animate at all, for anyone. */

.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(51, 40, 43, 0.18);
    max-width: 640px;
    width: 100%;
    max-height: 82vh;
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #efe5db;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

.modal-body {
    padding: 8px 20px 20px;
    overflow-y: auto;
}

.day-booking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed #efe5db;
}

.day-booking-row:last-child {
    border-bottom: none;
}

.day-booking-time {
    font-weight: 700;
    min-width: 84px;
}

.day-booking-info {
    flex: 1;
    font-size: 0.9rem;
}

.day-booking-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.day-booking-actions .btn {
    margin: 0;
}

.modal-empty {
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

/* ===== Day modal (tap a calendar cell) =====
   A day's appointments with their quick actions. Wider and airier than the
   generic modal on a desktop, and a full-width stacked card per booking on a
   phone so the actions never squeeze the time/info line. */
#dayModal .modal {
    max-width: 760px;
}

#dayModal .modal-body {
    padding: 10px 16px 16px;
}

/* One booking: a time rail, the dog/service block, then the actions. */
#dayModal .day-booking-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 14px;
    padding: 14px 7px;
    border-bottom: 1px dashed #efe5db;
}

#dayModal .day-booking-row:last-child {
    border-bottom: none;
}

#dayModal .day-booking-time {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--primary-dark);
    min-width: 0;
    padding-top: 1px;
    white-space: nowrap;
}

#dayModal .day-booking-info {
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

#dayModal .day-booking-info strong {
    color: var(--text);
}

/* The chips/badges sit inline inside the text run, so give them a little
   breathing room rather than relying on flex gaps. */
#dayModal .day-booking-info .status-badge,
#dayModal .day-booking-info .cal-book-chip,
#dayModal .day-booking-info .dog-photo-thumb {
    margin: 0 2px;
    vertical-align: middle;
}

#dayModal .day-booking-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 320px;
}

#dayModal .day-booking-actions .btn {
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 860px) {
    /* Stack: the time and info share the top line, the actions drop below and
       spread across the row, so nothing is cramped. */
    #dayModal .day-booking-row {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 13px 4px;
    }
    #dayModal .day-booking-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        max-width: none;
        margin-top: 4px;
    }
}

@media (max-width: 640px) {
    #dayModal .modal {
        max-width: none;
        max-height: 92vh;
        max-height: 92dvh;
    }
    #dayModal .modal-header {
        padding: 14px 16px;
    }
    #dayModal .day-booking-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }
    /* Actions become an even two-up grid filling the row. */
    #dayModal .day-booking-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    #dayModal .day-booking-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.dog-photo-lg { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.booking-detail-header { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px; }
.booking-detail-name { margin: 0; color: var(--primary-dark); }
.booking-detail-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; padding: 12px 0; border-top: 1px solid #efe5db; border-bottom: 1px solid #efe5db; font-size: 0.92rem; }
/* .detail-grid hosts full-width .detail-row blocks (each with its own label/value
   columns); spanning keeps auto-placement from squeezing every other row into the
   140px track and letter-wrapping the values. */
.detail-grid > .detail-row { grid-column: 1 / -1; }
.detail-label { color: var(--muted); }
.detail-value { font-weight: 600; }
.detail-notes, .detail-deposits { margin-top: 14px; }
.detail-section-title { font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.detail-notes p { margin: 0; white-space: pre-wrap; font-size: 0.92rem; }
.detail-deposits ul { margin: 0; padding-left: 18px; font-size: 0.92rem; }

.booking-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 2px 0 12px;
}

.booking-more {
    position: relative;
    display: inline-block;
}

.booking-more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.booking-more-toggle .admin-dropdown-caret {
    transition: transform var(--dur-1) ease;
}

.booking-more-toggle[aria-expanded="true"] .admin-dropdown-caret {
    transform: rotate(180deg);
}

.booking-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    min-width: 210px;
    background: #fff;
    border: 1px solid #efe4dd;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(51, 40, 43, 0.14);
    padding: 6px;
}

.booking-more-item {
    appearance: none;
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.booking-more-item:hover {
    background: #f7ece6;
    color: var(--primary-dark);
}

.booking-more-item--danger {
    color: #d64545;
}

.booking-more-item--danger:hover {
    background: #fbe1e1;
    color: #b53030;
}

/* ===== Context menu ===== */
.ctx-menu {
    position: fixed;
    z-index: 300;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(51, 40, 43, 0.16);
    padding: 6px;
    min-width: 180px;
}

.ctx-menu-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
}

.ctx-menu-item:hover {
    background: #f7ece6;
}

/* ===== Calendar closed / drag states ===== */
.cal-day-closed {
    background: repeating-linear-gradient(45deg, rgba(196, 129, 143, 0.06) 0 10px, transparent 10px 20px);
}

.cal-closed-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 6px;
    background: #fbe1e1;
    color: #d64545;
    font-size: 0.68rem;
    font-weight: 700;
}

.cal-day-drop {
    outline: 3px dashed var(--primary);
    outline-offset: -3px;
    background: #f7ece6;
}

.cal-book-dragging {
    opacity: 0.4;
}

/* ===== Calendar booking status colors ===== */
.cal-book-pending {
    border-left-color: #f0b429;
    background: #fff9e8;
}

.cal-book-confirmed {
    border-left-color: #2e9e5b;
    background: #eefaf2;
}

.cal-book-cancelled {
    border-left-color: #d64545;
    background: #fdf0f0;
}

.cal-book-completed {
    border-left-color: #4f46e5;
    background: #f0f1fe;
}

.cal-day {
    cursor: pointer;
}

/* ===== Week view ===== */
.week-view {
    margin-top: 20px;
}

/* The Week grid is its own thing, not the Month grid with one row: it draws a
   five-column week with `.week-col` columns and `.week-block` appointment
   blocks, and carries its own styling so a change to a Month cell cannot
   reshape the Week view. The look matches the Month day cell -- booked blocks
   coloured by status with a balance tag, the day-off chips, a Closed tag --
   because staff read the two the same way, not because the rules are shared. */
.week-grid {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.week-grid-head,
.week-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.week-grid-head {
    border-bottom: 1px solid #f1e9e1;
}

.week-grid-weekday {
    padding: 8px;
    border-right: 1px solid #f1e9e1;
    font-size: 0.82rem;
}

.week-grid-weekday:last-child {
    border-right: none;
}

.week-row {
    border-bottom: 1px solid #f1e9e1;
}

.week-col {
    box-sizing: border-box;
    position: relative;
    height: 160px;
    overflow: hidden;
    padding: 8px;
    border-right: 1px solid #f1e9e1;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.week-col:last-child {
    border-right: none;
}

.week-col.is-closed {
    background: #faf7f4;
}

.week-col.is-drop-target {
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

.week-col-num {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.week-col-digit {
    font-weight: 700;
    line-height: 1;
}

.week-col-closed {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
}

.week-col-body {
    position: absolute;
    top: 26px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.week-block {
    box-sizing: border-box;
    width: 100%;
    border-left: 3px solid var(--secondary);
    border-radius: 0 3px 3px 0;
    padding: 1px 4px;
    font-size: 0.7rem;
    line-height: 1.25;
    cursor: pointer;
    position: relative;
}

.week-block::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -3px;
    width: 3px;
    height: 2px;
    background: var(--secondary);
}

.week-block:last-child::before {
    display: none;
}

.week-block.is-dragging {
    opacity: 0.5;
}

.week-block.week-block-pending {
    background: #fff9e8;
    border-left-color: #f0b429;
}

.week-block.week-block-pending::before {
    background: #f0b429;
}

.week-block.week-block-confirmed {
    background: transparent;
    border-left-color: #2e9e5b;
}

.week-block.week-block-confirmed::before {
    background: #2e9e5b;
}

.week-block.week-block-cancelled {
    background: transparent;
    border-left-color: #d64545;
}

.week-block.week-block-cancelled::before {
    background: #d64545;
}

.week-block.week-block-completed {
    background: #f0f1fe;
    border-left-color: #4f46e5;
}

.week-block.week-block-completed::before {
    background: #4f46e5;
}

.week-block.week-block-short {
    background: #e0eef2;
    border-left-color: #0e7490;
}

.week-block.week-block-short::before {
    background: #0e7490;
}

.week-block-text {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.week-block-text.has-balance {
    padding-right: 44px;
    box-sizing: border-box;
}

.week-block .cal-balance-tag {
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    margin-left: 0;
    padding: 0 4px;
    font-size: 0.62rem;
}


.calendar-nav-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== Calendar hint ===== */
.calendar-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* ===== Admin booking form ===== */
.admin-toolbar h2 {
    margin: 0;
}

/* ===== Size table ===== */
.section-subtitle {
    text-align: center;
    color: var(--muted);
    margin: -24px 0 32px;
    font-size: 1.05rem;
}

.table-wrap {
    max-width: 860px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    overflow-x: auto;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.size-table thead th {
    font-family: 'Fraunces', serif;
    font-size: 1.05rem;
    color: var(--primary-dark);
    padding: 14px 12px;
    border-bottom: 2px solid var(--primary);
}

.size-table tbody td {
    padding: 16px 12px;
    border-bottom: 1px dashed #efe5db;
    color: var(--text);
}

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

.size-table tbody tr:hover {
    background: var(--bg);
}

.size-label {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: var(--primary-dark);
}

.size-price {
    font-weight: 700;
    color: var(--primary-dark);
}

.size-flat-body .size-flat-head td {
    padding: 18px 12px 6px;
    text-align: center;
    font-family: 'Fraunces', serif;
    font-size: 0.95rem;
    color: var(--primary-dark);
    border-bottom: 1px dashed #efe5db;
}

.size-price-flat {
    color: var(--primary-dark);
}

.size-flat-note {
    font-weight: 500;
    color: var(--muted);
    font-size: 0.82rem;
}

.size-note {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 20px;
}

.size-reference {
    max-width: 860px;
    margin: 16px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    justify-content: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.size-reference p {
    margin: 0;
}

/* ===== Service manager (settings) ===== */
.settings-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.settings-section-head h3 {
    margin-bottom: 2px;
}

.settings-section-head p {
    margin: 0;
}

.svc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.svc-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.svc-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.svc-card-head h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
}

.svc-card-head .status-badge {
    white-space: nowrap;
}

.svc-desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.svc-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.svc-price {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    background: #f7ece6;
    border: 1px solid #efe5db;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.svc-price b {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.svc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.svc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.svc-actions form {
    margin: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--primary-dark);
    font-size: 1rem;
    line-height: 1;
}

.btn-icon:disabled,
.btn-icon:disabled:hover {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.svc-card-inactive {
    opacity: 0.7;
}

/* ===== Notifications (settings) ===== */
.notif-intro {
    max-width: 60ch;
    margin-bottom: 16px;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 16px;
    border: 1px solid #efe5db;
    border-radius: 10px;
    background: var(--card-bg, #fff);
}

.notif-row.is-on {
    border-color: #e7c9b7;
}

.notif-info {
    min-width: 0;
}

.notif-info h4 {
    margin: 0 0 2px;
    font-size: 1rem;
}

.notif-info p {
    margin: 0;
}

.notif-recipient {
    margin-top: 4px !important;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.notif-recipient-help {
    margin-top: 1px !important;
    font-size: 0.82rem;
}

.notif-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.notif-switch-form {
    margin: 0;
}

.notif-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.notif-switch:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 8px;
}

.notif-switch-track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d9cec4;
    transition: background var(--dur-1) ease;
    flex-shrink: 0;
}

.notif-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform var(--dur-1) ease;
}

.notif-switch.is-on {
    color: var(--primary-dark);
}

.notif-switch.is-on .notif-switch-track {
    background: var(--primary);
}

.notif-switch.is-on .notif-switch-thumb {
    transform: translateX(18px);
}

.notif-switch-state {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

.notif-switch.is-on .notif-switch-state {
    color: var(--primary-dark);
}

.notif-switch.is-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.notif-coming-soon {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f1eae3;
    border-radius: 999px;
    padding: 2px 8px;
}

@media (max-width: 640px) {
    .notif-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .notif-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* Service modals */
.modal-body .form {
    max-width: none;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.form-hint {
    font-size: 0.82rem;
    margin-top: 2px;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.modal-footer .btn {
    margin: 0;
}

.modal > .modal-footer {
    flex-shrink: 0;
    margin-top: 0;
    padding: 14px 20px;
    border-top: 1px solid #efe5db;
    justify-content: flex-end;
    background: #fff;
}

.form-checkbox {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding-top: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.form-checkbox input {
    width: auto;
}

/* ===== Admin responsive ===== */
@media (max-width: 860px) {
    .svc-grid {
        grid-template-columns: 1fr;
    }

    .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .week-grid {
        min-width: 720px;
    }

    .day-booking-actions {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .modal {
        max-height: 90vh;
        max-height: 90dvh;
    }
}

/* ===== Admin gallery AI editor ===== */
.ai-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-original img {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: var(--radius);
    background: repeating-conic-gradient(#f0f0f0 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
}

.ai-original p {
    margin: 6px 0 0;
    text-align: center;
}

.ai-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-replace {
    border-top: 1px dashed #efe5db;
    padding-top: 14px;
}

.ai-replace h4 {
    margin: 0 0 10px;
    color: var(--primary-dark);
}

.ai-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    align-items: center;
}

.ai-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.ai-prompt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid #efe5db;
    border-radius: var(--radius);
    background: #fff;
}

.ai-prompt-meta {
    flex: 1;
    min-width: 0;
}

.ai-prompt-meta strong {
    display: block;
    margin-bottom: 2px;
    color: var(--primary-dark);
}

.ai-prompt-meta span {
    display: block;
    color: #8a8178;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-replace textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.ai-status {
    border-top: 1px dashed #efe5db;
    padding-top: 14px;
}

.ai-result img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid #efe5db;
}

.ai-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ===== Before/After gallery ===== */
.gallery-item.is-before img {
    transform: none;
}

.gallery-item {
    position: relative;
}

.ba-before-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: inline-block;
    background: var(--accent);
    color: #7a5a00;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    pointer-events: none;
}

.placement-badge.placement-before {
    background: #e0eef2;
    color: #0e3a61;
}

.placement-badge.placement-after {
    background: var(--accent);
    color: #4d3a00;
}

.pair-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    vertical-align: middle;
    margin-right: 4px;
    object-fit: cover;
}

.ba-modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.ba-modal-body .ba-figure {
    flex: 1 1 260px;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.ba-modal-body .ba-figure img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid #efe5db;
}

.ba-modal-body .ba-before-badge,
.ba-modal-body .ba-after-badge {
    position: static;
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 6px;
}

.ba-modal-body .ba-before-badge {
    background: #e0eef2;
    color: #1565c0;
}

.ba-modal-body .ba-after-badge {
    background: var(--accent);
    color: #7a5a00;
}

/* ===== Admin gallery card ===== */
.upload-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.gallery-card-media {
    position: relative;
}

.gallery-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    pointer-events: none;
    z-index: 1;
}

.gallery-card-badges .placement-badge,
.gallery-card-badges .featured-badge {
    margin-bottom: 0;
}

.gallery-card-hover-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--dur-1) ease;
    z-index: 1;
}

.gallery-card:hover .gallery-card-hover-actions,
.gallery-card:focus-within .gallery-card-hover-actions {
    opacity: 1;
}

@media (hover: none) {
    .gallery-card-hover-actions {
        opacity: 1;
    }
}

.gallery-card-hover-actions .btn-danger {
    background: #d64545;
    color: #fff;
}

.inline-form {
    display: inline-block;
}

.gallery-card-title {
    margin-bottom: 2px;
}

.gallery-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.gallery-control-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.gallery-meta .gallery-control-form {
    display: flex;
}

.gallery-control-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.gallery-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #efe5db;
    border-radius: 8px;
    background: #fff;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

.gallery-select:focus {
    outline: none;
    border-color: var(--primary);
}

.gallery-pair-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1e9e1;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.gallery-pair-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pair-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pair-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.pair-pick {
    width: 48px;
    height: 48px;
    padding: 2px;
    border: 2px solid #efe5db;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}

.pair-pick img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.pair-pick:hover {
    border-color: var(--accent);
}

.pair-pick.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(51, 40, 43, 0.25);
}

/* ===== Month mini time-grid ===== */
