.cem-portal,.cem-module2 { max-width:1100px; margin:32px auto; padding:0 18px; color:#172b3a; font:16px/1.6 system-ui,sans-serif; }
.cem-portal { background:#f4f7fa; } body:has(>.cem-portal) { margin:0; background:#f4f7fa; }
.cem-eyebrow { text-transform:uppercase; letter-spacing:.12em; font-size:12px; color:#376477; font-weight:700; }
.cem-portal h1 { font-size:clamp(26px,5vw,36px); line-height:1.2; } .cem-card { background:white; border:1px solid #d2dde5; border-radius:8px; padding:22px; margin:24px 0; }
.cem-card h2 { margin-top:0; } .cem-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; } .cem-field { display:block; margin:12px 0; font-weight:600; }
.cem-field span { display:block; margin-bottom:5px; } .cem-field input,.cem-field select,.cem-field textarea { width:100%; min-height:42px; box-sizing:border-box; border:1px solid #859cac; border-radius:4px; padding:9px; font:inherit; color:inherit; background:white; }
.cem-check { display:block; margin:12px 0; } .cem-check input { width:18px; height:18px; margin-right:8px; }
body:not(.cem-theme-portal) .cem-portal .button { display:inline-block; margin:14px 8px 8px 0; padding:11px 18px; border:1px solid #135e96; border-radius:5px; color:#fff; background:#135e96; font:inherit; cursor:pointer; text-decoration:none; }
body:not(.cem-theme-portal) .cem-portal a { color:#12517f; } body:not(.cem-theme-portal) .cem-portal .button:hover { background:#0c4068; } body:not(.cem-theme-portal) .cem-portal :focus-visible { outline:3px solid #d08400; outline-offset:3px; }
.cem-notice { padding:16px; background:#e3f5e9; border-left:4px solid #287d48; } .cem-error { border-color:#b42318; background:#fff0ee; padding:14px; }
.cem-ticket-row { margin:16px 0; border:1px solid #d2dde5; border-radius:6px; padding:16px; } .cem-stats { display:flex; flex-wrap:wrap; gap:32px; } .cem-quote { padding:18px; border:2px solid #135e96; border-radius:6px; }
.cem-portal details { margin:16px 0; } .cem-portal summary,.cem-module2 summary { cursor:pointer; font-weight:700; min-height:36px; } .cem-portal footer { padding:22px 0 40px; }
.cem-honeypot { position:absolute; width:1px; height:1px; overflow:hidden; left:-10000px; } .cem-module2 table { display:block; max-width:100%; overflow-x:auto; } .cem-module2 td form { margin-bottom:5px; }
.cem-catalogue-selected { background:#e8f2fa; padding:8px; font-weight:700; } .cem-catalogue-status:not(:empty) { padding:12px; border-left:4px solid #135e96; background:#fff; }
.cem-catalogue-status.cem-error { border-left-color:#b32d2e; background:#fcf0f1; color:#8a2424; font-weight:600; }
.cem-attendance-row { border:1px solid #d2dde5; border-radius:6px; padding:16px; margin:12px 0; } .cem-attendance-row legend { font-weight:600; padding:0 6px; } .cem-attendance input[type="datetime-local"] { min-height:40px; }
@media(max-width:700px) { .cem-grid { grid-template-columns:1fr; gap:4px; } .cem-card { padding:17px; } .cem-portal { padding:0 12px; } }

.cem-table-wrap { max-width:100%; overflow-x:auto; margin:14px 0; }
.cem-booking-summary { width:100%; border-collapse:collapse; text-align:left; }
.cem-booking-summary th,.cem-booking-summary td { padding:12px; border-bottom:1px solid #d2dde5; vertical-align:top; }
.cem-booking-summary th { background:#eef3f7; }
.cem-booking-summary .cem-number { text-align:right; white-space:nowrap; }
.cem-portal .cem-net-charges,.cem-module2 .cem-net-charges { font-size:22px; font-weight:700; line-height:1.4; }
.cem-booking-context { overflow-wrap:anywhere; }

.cem-navigation,.cem-tabs-nav { display:flex;flex-wrap:wrap;gap:10px;margin:18px 0; }
.cem-navigation a,.cem-tabs-nav a { padding:10px 14px;border:1px solid #c4d2de;border-radius:6px;background:#fff;text-decoration:none; }
.cem-tabs-nav a[aria-current="page"] { background:#135e96;color:#fff;border-color:#135e96; }
.cem-stats { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:stretch;margin:20px 0; }
.cem-stats p { margin:0;padding:16px;background:#f4f7fa;border-radius:6px;font-size:16px;line-height:1.6;font-weight:400; }
.cem-stats strong { display:block;margin-top:3px;font-size:22px;line-height:1.4; }
.cem-stats br { display:none; }
@media(max-width:650px){.cem-stats{grid-template-columns:1fr;}.cem-tabs-nav a{flex:1;text-align:center;}}

@media(max-width:600px){.cem-rota-table thead{display:none;}.cem-rota-table,.cem-rota-table tbody,.cem-rota-table tr{display:block;width:100%;}.cem-rota-table tr{border-bottom:2px solid #d2dde5;margin-bottom:12px;}.cem-rota-table td{display:grid;grid-template-columns:65px minmax(0,1fr);gap:12px;padding:10px 0;overflow-wrap:anywhere;}.cem-rota-table td::before{content:attr(data-label);font-weight:700;}}

.cem-portal .cem-tabs-nav {display:flex;flex-wrap:wrap;align-items:stretch;gap:12px; padding:12px 0; border-bottom:1px solid #d2dde5;}
.cem-portal .cem-tabs-nav a {display:inline-block;line-height:1.4;min-height:24px;padding:12px 16px;margin:0;}
.cem-actions {display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:16px 0;}
.cem-portal .cem-actions .button {margin:0;}
body:not(.cem-theme-portal) .cem-portal .button.cem-secondary {background:#fff;color:#135e96;}
.cem-allocation {padding:18px;border:1px solid #d2dde5;background:#f4f7fa;border-radius:6px;margin:18px 0;}
.cem-allocation h3 {margin-top:0;}
[data-cem-section-note] {align-self:center;font-weight:600;}
#participants {scroll-margin-top:24px;}
.cem-event-choice {padding:12px 0;border-bottom:1px solid #d2dde5;}
.cem-event-choice:last-child {border-bottom:0;}
.cem-booking-overview td {min-width:95px;}
.cem-booking-overview td:first-child {min-width:140px;}

@media(max-width:700px){.cem-booking-overview thead{display:none;}.cem-booking-overview,.cem-booking-overview tbody,.cem-booking-overview tr{display:block;width:100%;}.cem-booking-overview tr{border-bottom:2px solid #d2dde5;margin-bottom:16px;}.cem-booking-overview td,.cem-booking-overview td:first-child{display:grid;grid-template-columns:110px minmax(0,1fr);gap:12px;min-width:0;padding:10px 0;overflow-wrap:anywhere;}.cem-booking-overview td::before{content:attr(data-label);font-weight:700;}.cem-booking-overview .button{margin:0;}}

.cem-profile-state{display:inline-block;padding:4px 9px;border-radius:4px;font-size:14px;font-weight:600;}.cem-profile-state.incomplete{background:#fff3cd;color:#664d03;}.cem-profile-state.complete{background:#e6f3e9;color:#225d35;}

/* Event rota planner. Contain the wide calendar within its own scroll area. */
.cem-rota-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:18px 0}.cem-rota-filters .cem-field{flex:1 1 190px;min-width:160px;margin:0}.cem-rota-filters select{max-width:100%}.cem-rota-filters .button{margin:0}
.cem-rota-person{border:1px solid #d5e1eb;border-radius:6px;padding:16px;margin:14px 0;background:#fff}.cem-rota-person h3,.cem-rota-person h4{margin-top:0}.cem-rota-action{margin:10px 0}.cem-rota-action .button{margin:6px 0}.cem-rota-action textarea{max-width:650px}
.cem-rota-scroll{max-width:100%;overflow:auto;border:1px solid #ccd6df;border-radius:6px}.cem-rota-grid{border-collapse:separate;border-spacing:0;table-layout:fixed;width:100%;min-width:1300px;font-size:13px}.cem-rota-grid th,.cem-rota-grid td{border-right:1px solid #d7e0e8;border-bottom:1px solid #d7e0e8;padding:10px;vertical-align:top;overflow-wrap:anywhere}.cem-rota-grid thead th{background:#eaf0f5;color:#18344c;text-align:left;position:sticky;top:0;z-index:2}.cem-rota-grid th:first-child{width:175px;position:sticky;left:0;background:#f5f8fa;z-index:1}.cem-rota-grid thead th:first-child{z-index:3}.cem-rota-grid small,.cem-rota-tile span{display:block}.cem-rota-grid small{margin-top:5px;font-weight:400}.cem-rota-tile{display:block;border-left:4px solid #2271b1;background:#edf5fd;padding:8px;margin-bottom:8px;text-decoration:none!important;border-radius:3px;color:#153b5b!important;line-height:1.45}.cem-rota-tile strong{display:block}.cem-rota-open .cem-rota-tile{background:#f5f7f9}.cem-rota-tile.needs-staff{border-left-color:#bd7200;background:#fff5df}.cem-rota-tile.covered{border-left-color:#33864b;background:#edf8ee}.cem-rota-group .cem-rota-tile{border-left-color:#8054ac;background:#f3edf9}.cem-rota-empty{color:#8697a5}.cem-rota-list td{min-width:135px}.cem-rota-list p{margin:4px 0}
@media(max-width:700px){.cem-rota-filters{display:block}.cem-rota-filters .cem-field{margin:12px 0}.cem-rota-grid{min-width:1150px}.cem-rota-grid th:first-child{width:135px}}

.cem-rota-day-shifts summary{cursor:pointer;margin:8px 0;font-weight:500}.cem-rota-day-shifts>div{max-height:240px;overflow:auto}.cem-rota-grid tbody th{text-align:left}

.cem-dashboard-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(195px,1fr));gap:14px;margin:18px 0}.cem-dashboard-stat{border:1px solid #d3dfe8;border-top:3px solid #2271b1;border-radius:5px;background:#f6f9fb;padding:16px}.cem-dashboard-stat span,.cem-dashboard-stat strong,.cem-dashboard-stat small{display:block}.cem-dashboard-stat strong{font-size:25px;line-height:1.3;margin:8px 0;color:#16374f}.cem-dashboard-stat small{color:#526578;line-height:1.5}.cem-template-logo-preview img{max-width:180px;max-height:100px;object-fit:contain}.cem-template-editor textarea{max-width:850px}.cem-template-editor input[type=color]{height:46px;width:90px}

.cem-auth { max-width: 34rem; margin: 2rem auto; padding: 0 1rem; }
.cem-auth input:not([type="checkbox"]):not([type="hidden"]) { display: block; width: 100%; box-sizing: border-box; margin-top: .4rem; min-height: 44px; padding: .5rem; font: inherit; }

body.cem-theme-portal .cem-portal { font: inherit; color: inherit; background: transparent; }
body.cem-theme-portal .cem-portal :is(.wp-element-button, .button) { display: inline-block; margin: .5rem .5rem .5rem 0; cursor: pointer; text-decoration: none; }

/* Keep active navigation visible without applying a fixed brand colour in themed pages. */
body.cem-theme-portal .cem-portal .cem-tabs-nav a[aria-current="page"] { background: transparent; color: inherit; border-color: currentColor; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }

.cem-portal .cem-participant-numbers-heading { margin-top: 2.5rem; }
#cem-quote, #cem-portal-error { scroll-margin-top: 6rem; }

.cem-portal .cem-booking-title { font-size: var(--wp--preset--font-size--medium, 1.25em); line-height: 1.35; overflow-wrap: anywhere; }
.cem-admin .cem-status-badge.is-pending { display: inline-block; padding: 4px 8px; background: #fff3cd; color: #664d03; border-radius: 4px; font-weight: 600; }

#booking-change-log, [id^="cem-qualification-"], [id^="cem-finance-exception-"], [id^="cem-payment-intent-"] { scroll-margin-top: 5rem; }
.cem-change-log { margin-top: 2rem; }

.cem-idle-dialog { max-width: min(30rem, calc(100vw - 3rem)); border: 1px solid currentColor; border-radius: .5rem; padding: 1.5rem; color: inherit; font: inherit; }
.cem-idle-dialog::backdrop { background: rgb(0 0 0 / 45%); }

.cem-dashboard-detail > summary { cursor:pointer; padding:.25rem 0; }
.cem-dashboard-detail > summary h2 { display:inline; margin:0; }
.cem-dashboard-detail-body { padding-top:1rem; }
.cem-booking-navigation { display:flex; flex-wrap:wrap; gap:.5rem; margin:1rem 0; }
.cem-booking-back { margin-bottom:.5rem; }

.cem-portal-choices { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1rem;margin:1.5rem 0; }
.cem-portal-choices .cem-card { margin:0; }

.cem-required { font-size:.85em;font-weight:600; }
.cem-contact-number { margin:1rem 0;padding:1rem; }
.cem-contact-number legend { font-weight:600; }

/* Scroll targets are not interactive controls: avoid a selected-looking panel outline. */
#cem-booking-confirmation:focus, .cem-quote[tabindex="-1"]:focus, section#participants[tabindex="-1"]:focus { outline:none; }
