/* Persistent utilities, with section links in the mobile menu. */
.art-zoom{flex:none;white-space:nowrap;min-width:44px;min-height:44px;padding:8px 12px;margin-left:auto;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:3px;font:600 14px/1.3 'Segoe UI',Arial,sans-serif;cursor:pointer}
.art-dialog[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 16px)}
.art-dialog .dialog-heading,.art-dialog .art-controls{flex:none}
.art-dialog .art-controls[hidden]{display:none}
.art-dialog .art-scroll{flex:1;min-height:0;max-height:none}
.art-zoom[aria-pressed=true]{background:var(--gold);color:var(--ink)}
.art-scroll.is-enlarged>img{width:200%;max-width:none;height:auto;margin:0}
.art-scroll{overscroll-behavior:contain}
.art-dialog .dialog-heading h2{min-width:0;overflow-wrap:anywhere}
@media(max-width:1200px){
 #site-header #primary-nav{max-height:calc(100vh - var(--mobile-header-height,72px));max-height:calc(100dvh - var(--mobile-header-height,72px));overflow-y:auto;overscroll-behavior:contain;padding-bottom:max(24px,env(safe-area-inset-bottom))}
 .site-header #menu-toggle{min-width:44px;min-height:44px}
}
@media(max-width:700px){
 #site-header.site-header{padding-inline:12px;gap:8px}
 #site-header .brand{flex:none}
 #site-header .brand img{width:64px}
 #site-header .header-tools{gap:2px!important;margin-left:auto;flex:none}
 #site-header .preferences>.icon-button,#site-header .preferences summary,#site-header #feedback-controls-v51>button,#site-header #feedback-controls-v51 summary{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:12px!important}
 #site-header .menu-toggle{width:44px;min-width:44px;height:44px;border:0;flex:none}
 #site-header .language-switch{position:relative;width:52px;flex:none}
 #site-header .language-switch select{width:52px;max-width:52px;height:44px;min-height:44px;padding:0;border:0;font-size:16px;color:transparent;appearance:none;background:transparent;cursor:pointer}
 #site-header .language-switch select option{color:var(--text);background:var(--ink)}
 #site-header .language-short{display:flex;position:absolute;inset:0;gap:7px;align-items:center;justify-content:center;pointer-events:none;font:600 13px/1 'Segoe UI',Arial,sans-serif;color:var(--text)}
 #site-header .language-short::after{content:'';width:5px;height:5px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin-top:-3px}
 #site-header .theme-picker-panel,#site-header #feedback-controls-v51 .theme-picker-panel{right:-88px!important;width:min(240px,calc(100vw - 32px));max-height:calc(100dvh - 100px);overflow-y:auto}
 #site-header .theme-picker-panel button{min-height:44px}
 .whisperdex .dex-tools input,.whisperdex .dex-tools select,.vikypedia-book77 .book77-tools select{font-size:16px}
 html[data-theme] .shop-page #site-header .cart-button,html[data-theme] .shop-page #site-header #menu-toggle{width:44px;min-width:44px;flex-basis:44px;height:44px}
 #site-header #primary-nav svg{flex:none}
 .art-dialog{padding-bottom:env(safe-area-inset-bottom)}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

.language-short{display:none}
@media(max-width:370px){
 #site-header.site-header{padding-inline:8px;gap:4px}
 #site-header .brand img{width:48px}
}

/* B17: the viewer never resizes itself around an arriving image. */
#art-dialog.art-dialog[open]{position:fixed;inset:0;margin:auto;width:min(1000px,calc(100vw - 16px));height:calc(100vh - 16px);height:calc(100svh - 16px);max-height:calc(100svh - 16px);overflow:hidden}
#art-dialog .art-scroll{flex:1 1 0;min-height:0;position:relative;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
#art-dialog .art-scroll>#art-image{display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;margin:0 auto;user-select:none;-webkit-user-drag:none}
#art-dialog .art-scroll>#art-image[src*="world-andrea-color-source.jpg"]{object-fit:cover;aspect-ratio:590 / 584}
#art-dialog.art-is-loading #art-image,#art-dialog.art-load-failed #art-image{visibility:hidden}
#art-dialog .art-load-status{display:none;position:absolute;z-index:1;top:50%;left:20px;right:20px;text-align:center;pointer-events:none;font-size:15px;color:var(--text)}
#art-dialog.art-is-loading .art-load-status,#art-dialog.art-load-failed .art-load-status{display:block}
#art-dialog .art-load-status button{pointer-events:auto;min-height:44px;margin-top:12px;padding:8px 20px;border:1px solid var(--line);background:var(--panel);color:var(--text);font:inherit;cursor:pointer}
#art-dialog .art-load-status button[hidden]{display:none}
#art-dialog .art-zoom:disabled{opacity:.5;cursor:wait}
#art-dialog .dialog-heading{min-height:61px}
#art-dialog .dialog-heading h2{flex:1;font-size:clamp(15px,2vw,20px)}
@media(max-width:700px){#art-dialog.art-dialog[open]{width:100%;height:100vh;height:100svh;max-width:100%;max-height:100svh;border:0;border-radius:0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}#art-dialog .dialog-heading{padding:8px 12px;gap:8px}}
