/* Shared screen layout. Kept outside print rules and data/business logic. */
:root{--layout-width:1440px;--layout-gutter:clamp(12px,2.2vw,32px);--reading-width:800px;--editor-width:1100px}
@media screen{
 html body #nav #newEvent .button-label{display:inline!important;white-space:normal}
 html body .shared-site-header{box-sizing:border-box;display:flex!important;flex-wrap:wrap!important;width:100%;max-width:var(--layout-width);margin-inline:auto!important;padding:6px var(--layout-gutter)!important;gap:8px!important}
 html body .shared-site-header .shared-site-tools{flex:0 1 auto!important;flex-wrap:wrap!important;margin-left:auto!important;margin-right:0!important;padding:0!important}
 html body.factory-edit-page .shared-mobile-actions,html body.full-page-form .shared-mobile-actions{display:none!important}
 html body.full-page-form :is(.app,.archive-app){display:none!important}
 html body.full-page-form :is(#eventDialog,#archiveEditor)[open]{display:block!important;position:static!important;box-sizing:border-box;width:100%!important;max-width:var(--editor-width)!important;max-height:none!important;inset:auto!important;margin:0 auto!important;padding:clamp(16px,3vw,32px)!important;border:0!important;border-radius:0!important;background:var(--ui-surface,var(--surface,#fff));color:inherit;overflow:visible!important;box-shadow:none!important}
 html body.full-page-form :is(#eventDialog,#archiveEditor) :is(.dialog-head,.archive-dialog-head){position:static!important;margin:0 0 20px;padding:0;background:transparent!important}
 html body.full-page-form :is(#eventDialog,#archiveEditor) :is(.dialog-actions,.archive-detail-actions){position:sticky;bottom:0!important;z-index:3;display:flex;flex-wrap:wrap;gap:8px;padding:14px 0 max(14px,env(safe-area-inset-bottom))!important;background:var(--ui-surface,var(--surface,#fff))!important}
 html body.full-page-form #archiveEditor :is(input,textarea){box-sizing:border-box;width:100%;min-width:0;max-width:100%;font:inherit}
 html body.factory-edit-page #factoryForm,html body.full-page-form :is(#eventForm,#archiveEditForm){padding-bottom:140px!important}
 html body.factory-edit-page #factoryEditor .dialog-actions,html body.full-page-form :is(#eventDialog,#archiveEditor) :is(.dialog-actions,.archive-detail-actions){position:fixed!important;bottom:0!important;left:50%;transform:translateX(-50%);box-sizing:border-box;width:min(100%,var(--editor-width));margin:0!important;padding:12px var(--layout-gutter) max(12px,env(safe-area-inset-bottom))!important;border-top:1px solid var(--ui-line,var(--line,#dfe4e1));background:var(--ui-surface,var(--surface,#fff))!important;z-index:20}
 .site-skip-link{position:fixed;top:8px;left:12px;z-index:10000;transform:translateY(-200%);padding:12px 18px;border-radius:8px;background:var(--ui-surface,#fff);color:var(--ui-ink,#17201d);box-shadow:0 2px 12px #0002}
 .site-skip-link:focus{transform:none}
 html{scroll-padding-block:16px}
 html body :is(button,a,input,select,textarea,[contenteditable]):focus-visible{outline:2px solid var(--ui-primary,#315c4b);outline-offset:3px}
 html body :is(.event-name,.factory-broadcast-content,.detail-item,.factory-rich-wrap,.factory-filters label,.form-grid>*,.archive-search){min-width:0}
 html body :is(.event-name strong,.event-name small,.factory-air-title,.factory-air-field,.detail-item,.factory-detail-field dd,.factory-prompter-script){white-space:normal!important;overflow-wrap:anywhere;word-break:normal}
 html body .factory-prompter-script{white-space:pre-wrap!important}
 html body :is(.event-name strong,.event-name small){text-overflow:clip!important}
 html body :is(.event-actions,.dialog-actions,.factory-post-actions,.factory-editor-page-nav,.toolbar){flex-wrap:wrap;gap:8px}
 html body :is(.form-grid input,.form-grid select,.form-grid textarea,.factory-filters input,.factory-filters select){box-sizing:border-box;max-width:100%;min-width:0}
 html body :is(.factory-body,.archive-detail-body,.factory-rich-text) :is(img,video,iframe){max-width:100%;height:auto}
 html body :is(.factory-body,.archive-detail-body,.factory-rich-text){overflow-wrap:anywhere}
 html body .factory-shell,html body .archive-app,html body .factory-post-page,html body .app>main{
  box-sizing:border-box;width:100%;max-width:var(--layout-width)!important;min-width:0;margin-inline:auto!important;padding-inline:var(--layout-gutter)!important;
 }
 html body .app>.sidebar{box-sizing:border-box;width:100%;max-width:var(--layout-width)!important;margin-inline:auto!important;padding-inline:var(--layout-gutter)!important}
 html body .shared-site-header .shared-site-tools,html body .shared-site-header .shared-site-nav{
  box-sizing:border-box;max-width:var(--layout-width)!important;margin-inline:auto!important;padding-inline:var(--layout-gutter);
 }
 html body.factory-edit-page #factoryEditor[open]{width:100%!important;max-width:var(--editor-width)!important;margin-inline:auto!important}
 html body .factory-post .factory-body,html body .archive-detail-body{max-width:var(--reading-width);margin-inline:auto}
 html body .site-custom-page{box-sizing:border-box;width:100%;max-width:var(--layout-width);margin-inline:auto!important;padding-inline:var(--layout-gutter)!important}
 html body:has(#passwordForm)>main{box-sizing:border-box;width:100%;max-width:640px;margin-inline:auto!important;padding-inline:var(--layout-gutter)!important}
}
@media screen and (max-width:1100px){
 html body .app>.sidebar>#nav{flex-wrap:wrap!important;overflow:visible!important}
 html body .app>.sidebar>#nav .compact-tab-actions{flex-wrap:wrap;max-width:100%;margin-left:auto}
 html body .factory-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (max-width:760px){
 html body .app>.sidebar>#nav{gap:6px!important}
 html body .app>.sidebar>#nav .compact-tab-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;margin-left:0}
 html body .app>.sidebar>#nav .compact-tab-actions button{width:100%;white-space:normal;min-height:44px;justify-content:center;font-size:14px}
 html body .shared-site-header .shared-site-tools{flex-wrap:wrap;min-width:0}
 html body .shared-site-header .shared-mobile-actions{display:flex;order:2;flex:1 0 100%;flex-wrap:wrap;max-width:100%;margin:4px 0 2px;gap:8px}
 html body .shared-site-header .shared-mobile-actions:not(:has(button:not([hidden]):not(.hidden))){display:none}
 html body .shared-site-header .shared-mobile-actions button{min-height:44px;white-space:normal;max-width:100%}
 html body .shared-site-header :is(.shared-site-nav,.shared-app-menu){max-height:calc(100dvh - 100px);overflow-y:auto!important;overscroll-behavior:contain}
 html body .shared-site-header :is(.shared-site-nav a,.shared-app-menu button){min-height:44px}
 html body :is(button,.secondary,.primary,.icon-btn,.factory-tool-icon){min-height:44px;touch-action:manipulation}
 html body :is(.icon-btn,.factory-tool-icon){min-width:44px}
 html body :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font-size:16px!important;max-width:100%;min-width:0}
 html body :is(.form-grid,.factory-filter-panel .factory-filters){grid-template-columns:1fr!important}
 html body :is(.checks,.factory-term-options) label{min-height:40px;align-items:center}
 html body dialog:not(#factoryEditor){box-sizing:border-box;width:calc(100% - 24px)!important;max-width:900px!important;max-height:calc(100dvh - 24px)!important;padding:14px!important;overscroll-behavior:contain}
 html body dialog .dialog-actions{bottom:-14px!important;padding-bottom:max(12px,env(safe-area-inset-bottom))!important;background:var(--ui-surface,var(--surface,#fff))!important}
 html body.factory-edit-page #factoryEditor .dialog-actions{bottom:0!important;padding:12px 0 max(12px,env(safe-area-inset-bottom))!important;background:var(--ui-surface,var(--surface,#fff))!important;z-index:3}
 html body.factory-edit-page #factoryEditor .factory-rich-text{max-height:none;min-height:240px;font-size:16px}
 html body .factory-report-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
 html body .factory-report-summary>div{min-width:0;padding:10px}
 html body .factory-report-summary :is(strong,small){overflow-wrap:anywhere}
 html body .factory-air{display:block;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 html body .factory-editorial-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
 html body .factory-editorial-tabs button{white-space:normal}
 html body .archive-controls{grid-template-columns:minmax(0,1fr)!important}
 html body .archive-controls>*{min-width:0;grid-column:1!important}
}
@media screen and (max-width:420px){
 html body .detail-grid{grid-template-columns:1fr!important}
 html body .factory-report-summary{grid-template-columns:1fr}
 html body .factory-report-bar{grid-template-columns:minmax(70px,1fr) minmax(50px,1.5fr) 36px;gap:8px}
}
@media screen and (pointer:coarse){
 html body :is(.shared-theme-button,.shared-auth-button,.shared-menu-toggle,.shared-sections-toggle){min-height:44px!important;min-width:44px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}
