/* A single vertical scroll owner per dialog/pane; actions stay in reach. */
.history-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.history-tabs .btn[aria-pressed=true]{background:var(--ui-accent);color:var(--ui-accent-ink)}
body:is(.modal-open,.drawer-open){overflow:hidden}
body[data-theme] .modal:not(.service-order-window){display:flex;flex-direction:column;overflow:hidden;max-height:calc(100dvh - 32px)}
body[data-theme] .modal:not(.service-order-window) .modal-head{flex:none}
body[data-theme] .modal:not(.service-order-window) #modalForm{min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-block:16px 96px}
body[data-theme] .modal:not(.service-order-window) .modal-actions{bottom:0;margin-bottom:0;background:var(--ui-panel);padding-bottom:max(12px,env(safe-area-inset-bottom))}
.service-order-layout>.order-service-pane,.service-order-layout>.order-check-pane{overflow:visible;min-height:auto}
.order-menu-grid,.order-review-scroll,.line-editor-body{overscroll-behavior:contain;scroll-padding-bottom:20px}
.floor-world{will-change:transform}
.floor-stage.panning .floor-world{pointer-events:none}
.floor-filters-toggle{display:none}
.preview-atelier-dark{background:#141e19;border-color:#50614d}.preview-atelier-dark .preview-sidebar{background:#101a15}.preview-atelier-dark .preview-main{background:#223129}.preview-atelier-dark .preview-main i{background:#50614d}.preview-atelier-dark .preview-main .preview-banner{background:#a8c69a}
.preview-atelier-dark .preview-main .preview-card{background:#2b3c30;border-color:#50614d}.preview-atelier-dark .preview-main .preview-card.small{background:#3e4734}
body[data-theme="atelier-dark"] :is(.language-section,.choice-panel,.floor-map-filters,.order-line-editor,.layout-checks,.published-plan,.setup-canvas,.service-settings,.activity-row){background:var(--ui-panel);color:var(--ui-ink);border-color:var(--ui-line)}
body[data-theme="atelier-dark"] :is(.language-section p,.activity-row small,.choice-current,.choice-count,.choice-help,.floor-results){color:var(--ui-muted)}
body[data-theme="atelier-dark"] :is(.choice-option,.choice-segment,.choice-trigger,.language-option,.language-choice){background:var(--ui-panel-alt);color:var(--ui-ink);border-color:var(--ui-line)}
body[data-theme="atelier-dark"] :is(.alert,.alert.red){background:#42352a;color:#f5ceaa}
body[data-theme="atelier-dark"] :is(.badge,.badge.gray,.badge.blue,.badge.orange,.badge.red,.service-state,.arrival-state){background:var(--ui-panel-alt);color:var(--ui-ink)}
body[data-theme="atelier-dark"] :is(.attention-row,.service-table,.open-check,.check-preview,.station-ticket,.kitchen-course,.station-round){background:var(--ui-panel);color:var(--ui-ink);border-color:var(--ui-line)}
body[data-theme="atelier-dark"] :is(.attention-row small,.service-table-party,.service-table small,.activity-actor,.sub){color:var(--ui-muted)}
@media(pointer:coarse),(max-width:700px){
  body[data-theme] .floor-filters-toggle{display:inline-flex}
  body[data-theme] .floor-stage:not(.filters-open) .floor-map-filters{display:none}
  body[data-theme] .floor-stage.filters-open .floor-map-filters{max-height:40%;overflow:auto;overscroll-behavior:contain;background:var(--ui-panel,var(--card))}
  body[data-theme] .floor-toolbar{gap:6px}
  body[data-theme] .floor-toolbar-actions{flex-wrap:wrap;gap:6px}
  body[data-theme] .floor-toolbar-actions .floor-tool{min-height:44px;font-size:13px;padding:8px}
  body[data-theme] .service-floor .seat-panel{position:static;max-height:none;overflow:visible}
  body[data-theme] :is(.floor-list-areas,.floor-area-tabs,.order-seats,.order-categories){overscroll-behavior-x:contain;overscroll-behavior-y:auto;touch-action:pan-x pan-y}
  .floor-toolbar,.floor-map-filters,.floor-zoom,.seat-panel{touch-action:pan-x pan-y}
}
@media(max-width:700px){
  body[data-theme] .modal:not(.service-order-window){max-height:calc(100dvh - 16px);padding:16px}
  body[data-theme] .modal:not(.service-order-window) .modal-head{margin-bottom:12px}
  body[data-theme] .floor-zoom{gap:2px;max-width:calc(100% - 16px);right:8px}
  body[data-theme] .floor-zoom button{min-width:44px;min-height:44px;padding:8px}
}
