/* Shared by the customer booking pages and style editor. Every selector is scoped
   to their page class; shared admin styles and sticker geometry stay intact. */
body.test-calendar-page[data-test-theme] {
    color-scheme: dark;
    --primary: #c9a263;
    --primary-color: var(--primary);
    --primary-hover: #d9b67e;
    --bg-dark: #121212;
    --surface-dark: #1e1e1e;
    --surface-border: #454545;
    --text-main: #f5f5f5;
    --text-muted: #b0b0b0;
    --test-on-primary: #21190e;
    --test-raised: #252525;
    --test-day: #1b1b1b;
    --test-tint: #32291d;
    --test-booked-bg: #303030;
    --test-booked-text: #b6b6b6;
    --test-rest-bg: #382326;
    --test-rest-border: #87575c;
    --test-backdrop: rgba(0, 0, 0, 0.72);
    --test-shadow: rgba(0, 0, 0, 0.2);
}

body.test-calendar-page[data-test-theme="cream"] {
    color-scheme: light;
    --primary: #805633;
    --primary-hover: #694326;
    --bg-dark: #f7f2e9;
    --surface-dark: #fffdf8;
    --surface-border: #d8c9b4;
    --text-main: #30281f;
    --text-muted: #756553;
    --test-on-primary: #ffffff;
    --test-raised: #f2eadd;
    --test-day: #f7f2e9;
    --test-tint: #eee1cd;
    --test-booked-bg: #e9e3d9;
    --test-booked-text: #6a5f50;
    --test-rest-bg: #f6e3e0;
    --test-rest-border: #ba8a86;
    --test-backdrop: rgba(48, 40, 31, 0.5);
    --test-shadow: rgba(48, 40, 31, 0.08);
    --danger: #9b3936;
}

body.test-calendar-page[data-test-theme="sage"] {
    color-scheme: light;
    --primary: #27644b;
    --primary-hover: #1d503b;
    --bg-dark: #eff4f0;
    --surface-dark: #fcfefb;
    --surface-border: #c3d2c6;
    --text-main: #20372b;
    --text-muted: #586b5e;
    --test-on-primary: #ffffff;
    --test-raised: #e6eee8;
    --test-day: #eff4f0;
    --test-tint: #deebe1;
    --test-booked-bg: #e2e8e3;
    --test-booked-text: #57675b;
    --test-rest-bg: #f5e5e3;
    --test-rest-border: #b68985;
    --test-backdrop: rgba(32, 55, 43, 0.5);
    --test-shadow: rgba(32, 55, 43, 0.08);
    --danger: #963c38;
}

body.test-calendar-page[data-test-theme="metal"] {
    color-scheme: dark;
    --primary: #b4bfcc;
    --primary-hover: #d0d8e2;
    --bg-dark: #14171c;
    --surface-dark: #20252c;
    --surface-border: #46515f;
    --text-main: #eff3f8;
    --text-muted: #b0bac7;
    --test-on-primary: #141b23;
    --test-raised: #29313b;
    --test-day: #1a1f26;
    --test-tint: #2c3541;
    --test-booked-bg: #303842;
    --test-booked-text: #b6c0cd;
    --test-rest-bg: #3c292f;
    --test-rest-border: #88636c;
    --test-backdrop: rgba(8, 12, 18, 0.78);
    --test-shadow: rgba(0, 0, 0, 0.26);
    --danger: #f39ba9;
}

body.test-calendar-page[data-test-theme="metal"] .card,
body.test-calendar-page[data-test-theme="metal"] .style-panel {
    background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 48%, rgba(0, 0, 0, 0.08));
}

body.test-calendar-page[data-test-theme] .test-theme-picker {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--surface-dark);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
}

body.test-calendar-page[data-test-theme] .test-theme-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.test-calendar-page[data-test-theme] .test-theme-heading h1 {
    font-size: 17px;
    color: var(--text-main);
}

body.test-calendar-page[data-test-theme] .test-theme-badge {
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--text-muted);
}

body.test-calendar-page[data-test-theme] .test-theme-note {
    margin: 4px 0 12px;
    color: var(--text-muted);
    font-size: 12px;
}

body.test-calendar-page[data-test-theme] .test-theme-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body.test-calendar-page[data-test-theme] .test-theme-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 4px;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    background: var(--test-raised);
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

body.test-calendar-page[data-test-theme] .test-theme-option:hover {
    border-color: var(--primary);
}

body.test-calendar-page[data-test-theme] .test-theme-option[aria-pressed="true"] {
    border: 2px solid var(--primary);
    padding: 7px 3px;
    background: var(--test-tint);
    font-weight: 700;
}

body.test-calendar-page[data-test-theme] .test-theme-swatch {
    display: inline-block;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border: 1px solid var(--text-muted);
    border-radius: 50%;
}

body.test-calendar-page[data-test-theme] .test-theme-swatch-gold { background: #c9a263; }
body.test-calendar-page[data-test-theme] .test-theme-swatch-cream { background: #805633; }
body.test-calendar-page[data-test-theme] .test-theme-swatch-sage { background: #27644b; }

body.test-calendar-page[data-test-theme] .card,
body.test-calendar-page[data-test-theme] .test-ad-viewport {
    box-shadow: 0 4px 15px var(--test-shadow);
}

body.test-calendar-page[data-test-theme] .calendar-day:not(.calendar-day-empty):not(.calendar-day-vacation) {
    background: var(--test-day);
}

/* One shared row height fits the fullest date across the entire month. */
body.test-calendar-page[data-test-theme] .calendar-grid,
body.style-admin-page[data-test-theme] .sticker-calendar-grid {
    grid-template-rows: 28px;
    grid-auto-rows: var(--test-calendar-day-height, 104px);
}

body.test-calendar-page[data-test-theme] .calendar-day {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: var(--test-calendar-day-height, 104px);
}

body.test-calendar-page[data-test-theme] .test-day-slots {
    flex: 1;
    min-height: 0;
    gap: 4px;
    justify-content: flex-start;
}

body.test-calendar-page[data-test-theme] .test-day-slots span {
    flex-shrink: 0;
    padding: 0;
    font-size: 9px;
    line-height: 14px;
}

body.test-calendar-page[data-test-theme] .test-day-slots .is-closed {
    background: var(--test-booked-bg);
    border-color: var(--test-booked-text);
    color: var(--test-booked-text);
}

body.test-calendar-page[data-test-theme] .test-calendar-day-interactive:active {
    transform: none;
}

body.test-calendar-page[data-test-theme] .calendar-day-vacation {
    background: var(--test-rest-bg);
    border-color: var(--test-rest-border);
}

body.test-calendar-page[data-test-theme] .calendar-day-vacation .day-status.vacation {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin: 6px 0 2px;
    padding: 6px 0;
    border-radius: 8px;
    font-size: clamp(12px, 3.6vw, 16px);
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    word-break: break-all;
}

body.test-calendar-page[data-test-theme] .calendar-day-vacation .day-status.vacation.is-long-label {
    font-size: clamp(10px, 2.6vw, 12px);
    line-height: 1.15;
}

body.test-calendar-page[data-test-theme] .icon-btn {
    background: var(--test-raised);
}

body.test-calendar-page[data-test-theme] .test-day-open,
body.test-calendar-page[data-test-theme] .day-slots .is-open,
body.test-calendar-page[data-test-theme] .calendar-legend-swatch.is-open {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--test-on-primary);
    box-shadow: none;
}

body.test-calendar-page[data-test-theme] .test-day-full,
body.test-calendar-page[data-test-theme] .day-status.muted,
body.test-calendar-page[data-test-theme] .day-slots .is-full,
body.test-calendar-page[data-test-theme] .calendar-legend-swatch.is-full {
    background: var(--test-booked-bg);
    border-color: var(--test-booked-text);
    color: var(--test-booked-text);
}

body.test-calendar-page[data-test-theme] .test-ad-placeholder {
    background: linear-gradient(135deg, var(--test-tint), var(--surface-dark) 65%);
}

body.test-calendar-page[data-test-theme] .test-ad-dot {
    background: var(--text-muted);
}

body.test-calendar-page[data-test-theme] .test-ad-dot.is-active {
    background: var(--primary);
}

body.test-calendar-page[data-test-theme] .time-slots-backdrop {
    background: var(--test-backdrop);
}

body.test-calendar-page[data-test-theme] .time-slots-dialog {
    border-color: var(--surface-border);
    box-shadow: 0 18px 60px var(--test-shadow);
}

body.test-calendar-page[data-test-theme] .time-slots-close {
    background: var(--test-raised);
}

body.test-calendar-page[data-test-theme] .time-slots-handle {
    background: var(--text-muted);
}

body.test-calendar-page[data-test-theme] .time-slot-chip {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--test-on-primary);
}

body.test-calendar-page[data-test-theme] .secondary-btn:hover {
    background: var(--test-tint);
}

body.test-calendar-page[data-test-theme] button:focus-visible,
body.test-calendar-page[data-test-theme] a:focus-visible,
body.test-calendar-page[data-test-theme] .test-calendar-day-interactive:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    body.test-calendar-page[data-test-theme] .test-theme-option {
        transition: none;
    }
}
