/* Keep the page fixed to its viewport; wide calendars/tables scroll inside their own containers. */
html{width:100%;max-width:100%;overflow-x:clip;overscroll-behavior-x:none}
body{width:100%;max-width:100%;overflow-x:clip;overscroll-behavior-x:none;touch-action:pan-x pan-y}
#workspace,.drawer-panel,.read-detail-body{min-width:0;box-sizing:border-box}
body .drawer-panel{overflow-x:hidden}
.nx-vr,.nx-vr-section,.nx-vr-steps,.nx-vr-step,.nx-vr-span{min-width:0;max-width:100%}
.nx-vr :is(.nx-vr-title,.nx-vr-label,.nx-vr-sub,.nx-vr-lock,.nx-vr-facts dd){overflow-wrap:anywhere}
/* iOS focuses small inputs by zooming. Keep every editable control at a readable native size. */
@media(max-width:1100px){
 html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=button]):not([type=submit]),textarea,select,[contenteditable=true]){font-size:16px!important}
}

/* Drawers have their own scroll containers; the document guard cannot constrain them. */
html body :is(#overlay.drawer,dialog.drawer.read-detail-overlay)>.drawer-panel{overflow-x:hidden!important;overscroll-behavior-x:none;box-sizing:border-box}
html body .drawer-panel :is(.read-detail-body,.drawer-content,.drawer-mode-view,.site-drawer-workspace,.nx-site-drawer-content){min-width:0;max-width:none;overflow-x:clip!important;box-sizing:border-box}
/* Focus rings and card shadows reach past their element (cards: 24px). The clipped drawer bodies
   get inline padding with a matching negative margin, so nothing at the left or right edge is cut
   off (Taylor, 2026-11-16; widened from 8px for card shadows, round 6). The room stays inside the
   drawer's own padding (28px, 18px on phones), which the drawer doesn't clip. Nested bodies cancel
   out: each adds and removes the same amount. */
html body .drawer-panel{--nx-clip-room:24px}
@media(max-width:760px){html body .drawer-panel{--nx-clip-room:16px}}
html body .drawer-panel :is(.drawer-content,.drawer-mode-view,.site-drawer-workspace,.nx-site-drawer-content),html body :not(.nx-site-drawer)>.drawer-panel .read-detail-body{padding-inline:var(--nx-clip-room)!important;margin-inline:calc(-1 * var(--nx-clip-room))!important;width:auto}
html body .drawer-panel>:is(.drawer-heading,.dialog-heading){z-index:30!important}
html body .drawer-panel>:is(.drawer-heading,.dialog-heading)::before{left:0;right:0}

html body .drawer-panel>:is(.drawer-heading,.dialog-heading)>div{min-width:0;flex:1}
html body .drawer-panel>:is(.drawer-heading,.dialog-heading) h2{overflow-wrap:anywhere}

/* A calendar is live content, not a mask. Rounded paint belongs to its surface
   and first row; no WebKit clipping/isolated layer may enclose the visit tree. */
html body #workspace :is(.nx-sc-daylist,.nx-cal-head){overflow:visible!important;clip-path:none!important;-webkit-clip-path:none!important;isolation:auto!important;contain:none!important}
html body #workspace .nx-sc-daylist>.nx-sc-day{overflow:visible;clip-path:none;isolation:auto}
html body #workspace .nx-sc-daylist>.nx-sc-day>.nx-cal-phead:first-child{border-top-left-radius:20px;border-top-right-radius:20px;corner-shape:superellipse(2)}
html body #workspace .nx-sc-daylist>.nx-sc-day>:last-child{border-bottom-left-radius:20px;border-bottom-right-radius:20px;corner-shape:superellipse(2)}
html body #workspace .nx-cal-head{border-radius:0!important}
/* Legend artwork is ordinary vector paint, with the same paths as each event
   icon. It does not depend on a descendant CSS mask being invalidated. */
.nx-cal-key .nx-ev-mini>.nx-legend-glyph{display:block;width:13px;height:13px;flex:none;color:color-mix(in srgb,var(--pc,var(--sd-action)) 80%,var(--sd-text))}
/* A landscape phone uses the desktop rail surface too, never the dark floating
   dock's material. Keep row and lens corners identical at the 900px boundary. */
@media(min-width:900px){
 html body .dock{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;max-width:none}
 html body .dock a,html body .dock .lab-lens,html body #theme-button{border-radius:16px;corner-shape:round}
 html body .dock a{flex:none;flex-direction:row;min-width:0;justify-content:flex-start}
}
@media(min-width:900px) and (max-height:600px){
 html body .shell-header:has(.nexus-search){padding-right:12px!important}
 html body .dock{width:196px!important;gap:8px}
 html body .dock a{height:54px;min-height:54px;padding-inline:20px}
 html body .dock .lab-lens{height:54px}
 html body #theme-button{height:48px;min-height:48px;padding-inline:16px}
 html body #workspace{max-width:none!important;margin-right:0!important}
 html body #workspace>*{max-width:none!important;margin-inline:0!important}
}
