/* Unified usability and responsive behavior across Fira public and management screens. */
:root{--fira-control-height:44px;--fira-touch-gap:10px}
#main,#main *{box-sizing:border-box}
#main{min-width:0;max-width:100%;overflow-wrap:break-word}
#main :is(.panel,.detail,.category-listing,.category-detail-wrap,.shared-program,.shared-program-card,.event-card,.admin-panel,.admin-card,.staff-events,.staff-detail,.booking-panel,.booking-form,.calendar-page){min-width:0;max-width:100%}
#main :is(p,h1,h2,h3,h4,td,th,small,span){overflow-wrap:break-word}
#main :is(img,video,canvas){max-width:100%}
#main :is(input,select,textarea,button){font:inherit}
#main :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){max-width:100%;min-width:0}
#main :is(button,.btn,[role="button"],input[type="submit"],input[type="button"]){touch-action:manipulation}
#main :is(button,.btn,[role="button"],a):focus-visible,
dialog :is(button,.btn,input,textarea,select):focus-visible{outline:3px solid #4978bd;outline-offset:3px}
#main :is(.shared-card-photo,.category-card-image,.home-category-image,.event-detail-banner,.category-banner){background-color:#e9edeb}
#main :is(.shared-card-photo,.category-card-image,.event-card,.shared-program-card){contain:layout style}
#main :is(.shared-card-photo,.category-card-image) img{display:block;width:100%;height:100%;object-fit:cover}
#main :is(.admin-tabs,.calendar-jump,.category-navigation,.kind-navigation){overscroll-behavior-inline:contain}
#main :is(table){border-collapse:collapse;max-width:100%}
#main :is(.table-scroll,.table-responsive,.admin-table-wrap,.reservations-table-wrap){max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
dialog.media-dialog{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 28px);overflow:auto;overscroll-behavior:contain}
.talk-map-overlay,.fira-map-details{max-width:100vw}
.talk-map-dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 28px)}
@media(max-width:720px){
 #main{overflow-x:clip}
 #main :is(.detail,.category-detail-wrap .detail,.shared-program){width:100%}
 #main :is(.detail,.category-detail-wrap .detail)>*{min-width:0}
 #main :is(.filters,.shared-program-controls,.inline-person-actions,.admin-actions){max-width:100%;min-width:0}
 #main :is(.filters,.shared-program-controls) :is(input,select){flex:1 1 150px}
 #main :is(.btn,button,input[type="submit"],select){min-height:var(--fira-control-height)}
 #main :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){font-size:16px}
 #main :is(.shared-program-card,.event-card,.fira-speaker-card){width:100%;min-width:0}
 #main :is(.shared-card-info,.card-body,.fira-speaker-info){min-width:0}
 #main :is(.admin-tabs,.calendar-jump,.kind-navigation){scrollbar-width:none}
 #main :is(.admin-tabs,.calendar-jump,.kind-navigation)::-webkit-scrollbar{display:none}
 dialog.media-dialog{width:calc(100vw - 16px);max-width:none;padding:16px;border-radius:14px}
 .talk-map-dialog{width:calc(100vw - 16px);max-width:none}
}
@media(max-width:420px){
 #main :is(.filters,.shared-program-controls){gap:8px}
 #main :is(.filters,.shared-program-controls)>:is(input,select){flex-basis:100%}
 #main :is(.panel,.admin-panel,.staff-detail){overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){
 #main :is(.shared-program-card,.event-card,.btn){scroll-behavior:auto}
}
/* Faster decisions: show useful filters, do not hide recovery actions. */
#main .fira-clear-filters{flex:0 0 auto;min-height:42px;padding:9px 14px;border:1px solid #cbd7d3;border-radius:999px;background:#fff;color:#243e39;font-size:14px;font-weight:650;cursor:pointer}
#main .fira-clear-filters[hidden]{display:none!important}
#main .shared-program-modes button[aria-pressed="true"]{background:#192e40!important;color:#fff!important;border-color:#192e40!important}
#main .shared-program-modes button:focus-visible,#main .fira-clear-filters:focus-visible{outline:3px solid #447bbb;outline-offset:2px}
#main #result-count{font-size:14px;color:#53635f;font-weight:650;margin:12px 0 18px}
@media(max-width:620px){#main .fira-clear-filters{width:100%;justify-content:center}#main .shared-program-modes{width:100%;display:flex}#main .shared-program-modes button{flex:1}}

/* Reservation card belongs below the activity action/navigation buttons. */
#main .category-detail-wrap>.fira-booking-spotlight{width:min(100%,850px);margin:18px auto 26px;border:1px solid #e8e8e4;border-radius:21px;padding:clamp(18px,3.1vw,28px)!important;background:#f5f4ee!important;box-shadow:none;color:#1e211f}
#main .fira-booking-spotlight-head h2{margin:0 0 5px;font-size:clamp(22px,2.6vw,30px);line-height:1.13;letter-spacing:-.03em;color:#171c19}
#main .fira-booking-spotlight-head p{margin:0 0 22px;color:#646964;font-size:14px}
#main .fira-places-heading{display:flex;justify-content:space-between;gap:14px;align-items:baseline;margin:0 0 10px}
#main .fira-places-heading strong{font-size:16px;font-weight:750}
#main .fira-places-heading span{font-size:14px;color:#596059;font-variant-numeric:tabular-nums;white-space:nowrap}
#main .fira-places-progress{height:9px;border-radius:99px;background:#e0e2da;overflow:hidden;margin-bottom:20px}
#main .fira-places-progress>span{display:block;height:100%;border-radius:inherit;background:#526640;transition:width .25s ease}
#main .fira-booking-main-action{display:flex;align-items:center;justify-content:center;min-height:50px;width:100%;border:0;border-radius:14px;background:#174a82!important;color:#fff!important;font-weight:800;text-decoration:none}
@media(max-width:620px){#main .category-detail-wrap>.fira-booking-spotlight{margin:13px 0 22px;border-radius:17px;padding:18px!important}#main .fira-places-heading strong{font-size:14px}}

/* Nominal booking: one decision per screen, without stacked explanatory panels. */
body #main .demo-booking-editor{width:min(660px,calc(100% - 28px));margin:12px auto 36px;padding:0!important;background:transparent}
body #main .demo-booking-compact-head{display:flex;flex-direction:column;gap:4px;padding:8px 2px 14px}
body #main .demo-booking-compact-head .history-back{font-size:14px;margin:0 0 12px;min-height:32px;display:inline-flex;align-items:center;align-self:flex-start}
body #main .demo-booking-eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.065em;font-weight:750;color:#64737d}
body #main .demo-booking-compact-head h1{font-size:clamp(30px,5vw,38px);margin:0 0 2px!important;line-height:1.1}
body #main .demo-booking-activity{font-size:15px;margin:0!important;line-height:1.3;color:#394955}
body #main .demo-booking-capacity{font-size:13px;margin:5px 0 0!important;color:#627268;font-weight:700}
body #main .demo-booking-editor>.panel{display:flex!important;flex-direction:column;gap:14px!important;padding:16px!important;box-shadow:none!important}
body #main .demo-nominal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body #main .demo-nominal-grid legend{font-size:15px;margin-bottom:10px}
body #main .demo-nominal-person{min-height:58px;padding:10px 12px;border-radius:12px}
body #main .demo-add-person{margin:0!important;padding:7px 0;align-self:flex-start}
body #main .demo-booking-submit{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e9edf0;padding-top:12px}
body #main .demo-nominal-count{margin:0!important;font-size:13px;font-weight:700}
body #main .demo-booking-submit .booking-overview-button{min-height:48px;min-width:180px;display:inline-flex;align-items:center;justify-content:center}
body #main .demo-booking-submit .booking-overview-button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:620px){
 body #main .demo-booking-editor{margin:0 auto 10px;width:calc(100% - 28px)}
 body #main .demo-booking-compact-head{padding-top:2px;gap:3px}
 body #main .demo-booking-compact-head .history-back{margin-bottom:5px}
 body #main .demo-booking-compact-head h1{font-size:32px}
 body #main .demo-booking-editor>.panel{padding:13px!important;gap:12px!important;border-radius:15px!important}
 body #main .demo-nominal-grid{grid-template-columns:1fr}
 body #main .demo-nominal-grid legend{margin-bottom:7px}
 body #main .demo-nominal-person{min-height:56px;padding:8px 11px}
 body #main .demo-booking-submit{position:sticky;bottom:calc(env(safe-area-inset-bottom,0px) + 8px);z-index:25;background:#fff;box-shadow:0 -12px 20px #fff;border-radius:13px;padding:10px 3px 4px;flex-wrap:wrap}
 body #main .demo-booking-submit .booking-overview-button{width:100%;min-width:0;min-height:52px}
 body #main .demo-nominal-count{width:100%}
}

/* Reservation belongs immediately below the practical booking-status panel in the right column. */
#main .reference-detail>.detail>.fira-detail-right-column{grid-column:2;grid-row:1;min-width:0;display:flex;flex-direction:column;gap:12px;align-self:start;position:sticky;top:90px}
#main .reference-detail>.detail>.fira-detail-right-column>.event-detail-practical{position:static!important;top:auto!important;grid-column:auto!important;grid-row:auto!important;width:100%;margin:0;align-self:stretch;min-width:0}
#main .reference-detail>.detail>.fira-detail-right-column>.booking-overview{position:static!important;max-width:100%!important;width:100%!important;margin:0!important;box-sizing:border-box}
#main .reference-detail>.detail>.fira-detail-right-column>.fira-booking-spotlight{background:#f8faf8!important;border:1px solid #e4ebe6!important;border-radius:15px!important;box-shadow:none!important;padding:18px!important;color:#163f32!important}
#main .reference-detail>.detail>.fira-detail-right-column>.fira-booking-spotlight h2{font-size:19px!important;font-weight:750!important;color:#163f32!important;letter-spacing:-.02em}
#main .reference-detail>.detail>.fira-detail-right-column>.fira-booking-spotlight p{color:#5b6c62}
#main .reference-detail>.detail>.fira-detail-right-column >.fira-booking-spotlight .fira-booking-main-action{background:#174a82!important;color:white!important}
@media(max-width:850px){#main .reference-detail>.detail>.fira-detail-right-column{grid-column:1;grid-row:auto;position:static;top:auto;width:100%;order:2}#main .reference-detail>.detail>.fira-detail-right-column>.event-detail-practical{width:100%!important}}


/* Neutral route activity details; overrides legacy green from all earlier bundles. */
body #main .category-detail-wrap.reference-detail .event-detail-banner,
body #main .category-detail-wrap.reference-detail .event-detail-banner img,
body #main .category-banner,body #main .category-banner img{border-radius:0!important}
body #main .category-detail-wrap.reference-detail .fira-booking-main-action,
body #main .category-detail-wrap.reference-detail .booking-overview-button{background:#174a82!important;border-color:#174a82!important;color:#fff!important}
body #main .category-detail-wrap.reference-detail .fira-places-progress>span{background:#174a82!important}
body #main .category-detail-wrap.reference-detail .fira-booking-spotlight{
 background:#fff!important;border:1px solid #e1e6ec!important;color:#243549!important;
 max-width:100%!important;width:100%!important;min-width:0!important;box-shadow:none!important;
}
body #main .category-detail-wrap.reference-detail .fira-booking-spotlight h2{color:#243549!important}
body #main .category-detail-wrap.reference-detail.fair-type-excursion .sample-pois,
body #main .category-detail-wrap.reference-detail.fair-type-excursion .sample-pois-list button,
body #main .category-detail-wrap.reference-detail.fair-type-excursion .fira-trail-kpis>div{
 background:#f5f6f8!important;border-color:#e2e6ec!important;color:#263746!important;
}
@media(max-width:760px){
 body #main .category-detail-wrap.reference-detail{
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  min-width:0!important;overflow-x:clip!important;
 }
 body #main .category-detail-wrap.reference-detail .fira-trail-content,
 body #main .category-detail-wrap.reference-detail .sample-view-grid,
 body #main .category-detail-wrap.reference-detail .sample-map-wrap,
 body #main .category-detail-wrap.reference-detail .sample-profile,
 body #main .category-detail-wrap.reference-detail .sample-pois{
  max-width:100%!important;min-width:0!important;
 }
}
