/* Pill bar + header icon buttons rework (loaded last).
   One header grid: brand + three icon buttons on row 1, pill rail on row 2
   (phones, tablets, short landscape). At 1240px and up everything sits on one row.
   The rail never wraps: it scrolls sideways, snaps, and fades at the edges. */
html[data-theme] main.shell>nav.wb-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto auto;grid-template-areas:"brand tog prof out" "rail rail rail rail";align-items:center;gap:8px!important;flex-wrap:nowrap!important;padding:10px 0 8px!important;min-height:0!important;height:auto!important}
html[data-theme] .wb-header-controls{display:contents!important}
html[data-theme] .wb-brand{grid-area:brand;min-width:0;display:block!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;padding:0!important;margin:0!important;min-height:0!important;max-width:none!important;font-size:13px!important}
html[data-theme] .wb-header .theme-toggle{grid-area:tog}
html[data-theme] .wb-header .wb-profile{grid-area:prof}
html[data-theme] .wb-header .wb-logout{grid-area:out}
html[data-theme] .wb-header nav.page-switch{grid-area:rail}

/* the three icon buttons: same size, shape, colour and icon size */
html[data-theme] .wb-header .theme-toggle,
html[data-theme] .wb-header .wb-profile-btn,
html[data-theme] .wb-header .wb-logout button{position:relative!important;inset:auto!important;top:auto!important;right:auto!important;margin:0!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;border:0!important;border-radius:50%!important;background:var(--mac-fill,rgba(118,118,128,.16))!important;color:var(--mac-accent,#007AFF)!important;display:grid!important;place-items:center;box-shadow:none!important;font-size:0!important;line-height:0}
html[data-theme] .wb-header .wb-logout{display:flex!important;position:static!important;width:auto!important;min-height:0!important;background:none!important;border-radius:0!important}
html[data-theme] .wb-header .wb-profile{display:flex!important}
html[data-theme] .wb-header .theme-toggle i{display:none!important}
html[data-theme] .wb-header .theme-toggle::before{width:20px;height:20px}
html[data-theme] .wb-header .wb-profile-btn svg,html[data-theme] .wb-header .wb-logout svg{width:20px!important;height:20px!important;display:block}
html[data-theme] .wb-header .theme-toggle:hover,html[data-theme] .wb-header .wb-profile-btn:hover,html[data-theme] .wb-header .wb-logout button:hover{background:rgba(118,118,128,.28)!important}
html[data-theme] .wb-header .theme-toggle:active,html[data-theme] .wb-header .wb-profile-btn:active,html[data-theme] .wb-header .wb-logout button:active{transform:scale(.94)}
html[data-theme] .wb-header .theme-toggle:focus-visible,html[data-theme] .wb-header .wb-profile-btn:focus-visible,html[data-theme] .wb-header .wb-logout button:focus-visible,html[data-theme] .wb-header nav.page-switch a:focus-visible{outline:3px solid var(--mac-accent,#007AFF);outline-offset:2px}
/* profile menu opens under the button and never past the right edge */
html[data-theme] .wb-profile-menu{right:0;left:auto;max-width:calc(100vw - 16px)}

/* the rail */
html[data-theme] .wb-header nav.page-switch{display:flex!important;flex-wrap:nowrap!important;gap:4px!important;width:100%!important;max-width:none!important;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:12px;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding:3px!important;border-radius:14px!important;position:relative;-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 10px,#000 calc(100% - 18px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,#000 10px,#000 calc(100% - 18px),transparent 100%)}
html[data-theme] .wb-header nav.page-switch::-webkit-scrollbar{display:none}
html[data-theme] .wb-header nav.page-switch.at-start{-webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 18px),transparent 100%);mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 18px),transparent 100%)}
html[data-theme] .wb-header nav.page-switch.at-end{-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 10px,#000 100%);mask-image:linear-gradient(90deg,transparent 0,#000 10px,#000 100%)}
html[data-theme] .wb-header nav.page-switch.at-start.at-end{-webkit-mask-image:none;mask-image:none}
html[data-theme] .wb-header nav.page-switch a{flex:0 0 auto!important;min-width:76px!important;min-height:52px!important;scroll-snap-align:center;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px!important;white-space:nowrap!important;text-align:center;font-size:11.5px!important;line-height:1.1!important;padding:6px 12px 5px!important;border-radius:11px!important;margin:0!important;transform:none!important}
html[data-theme] .wb-header nav.page-switch a::before{width:20px!important;height:20px!important;margin:0!important;flex:none;vertical-align:baseline}
html[data-theme] .wb-header nav.page-switch a.active::before{opacity:1}
html[data-theme] .wb-header nav.page-switch a[href^="/promptbase"]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21l-7-4-7 4V5a2 2 0 012-2h10a2 2 0 012 2z'/%3E%3Cpath d='M9 9h6M9 13h4'/%3E%3C/svg%3E")}
html[data-theme] .wb-header nav.page-switch a[href^="/admin"]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E")}

@media (max-width:360px){html[data-theme] .wb-brand{font-size:11px!important;letter-spacing:-.02em!important}html[data-theme] main.shell>nav.wb-header{gap:6px!important}}
/* tablet and wider: icon beside label keeps the bar short */
@media (min-width:900px){
 html[data-theme] .wb-header nav.page-switch a{flex-direction:row!important;min-width:0!important;min-height:38px!important;gap:6px!important;font-size:13px!important;padding:0 12px!important}
 html[data-theme] .wb-header nav.page-switch a::before{width:16px!important;height:16px!important}
}
html[data-theme] .wb-bs .wb-header .wb-header-controls nav.page-switch a.wb-admin-link{font-size:11.5px!important;min-height:52px!important;display:flex!important}
@media (min-width:900px){html[data-theme] .wb-bs .wb-header .wb-header-controls nav.page-switch a.wb-admin-link{font-size:13px!important;min-height:38px!important}}
@media (max-height:520px) and (orientation:landscape){html[data-theme] .wb-bs .wb-header .wb-header-controls nav.page-switch a.wb-admin-link{font-size:13px!important;min-height:40px!important}}
/* desktop: one row, icon beside label */
@media (min-width:1440px){
 html[data-theme] main.shell>nav.wb-header{grid-template-columns:auto minmax(0,1fr) auto auto auto;grid-template-areas:"brand rail tog prof out";gap:10px!important}
 html[data-theme] .wb-brand{margin-right:6px!important}
 html[data-theme] .wb-header nav.page-switch{width:auto!important;justify-self:start;max-width:100%!important}
 html[data-theme] .wb-header nav.page-switch a{flex-direction:row!important;min-width:0!important;min-height:38px!important;gap:6px!important;font-size:13px!important;padding:0 12px!important}
 html[data-theme] .wb-header nav.page-switch a::before{width:16px!important;height:16px!important}
}
/* short landscape phones: keep the bar low so the page keeps most of the screen */
@media (max-height:520px) and (orientation:landscape){
 html[data-theme] main.shell>nav.wb-header{position:static!important;padding:6px 0 6px!important}
 html[data-theme] .wb-header .theme-toggle,html[data-theme] .wb-header .wb-profile-btn,html[data-theme] .wb-header .wb-logout button{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important}
 html[data-theme] .wb-header nav.page-switch a{flex-direction:row!important;min-width:0!important;min-height:40px!important;gap:6px!important;font-size:13px!important;padding:0 12px!important}
 html[data-theme] .wb-header nav.page-switch a::before{width:16px!important;height:16px!important}
}
/* right-to-left: pills and buttons mirror, icons that point stay as drawn */
[dir=rtl] html[data-theme] .wb-header nav.page-switch,html[dir=rtl][data-theme] .wb-header nav.page-switch{direction:rtl}
@media (prefers-reduced-motion:reduce){html[data-theme] .wb-header nav.page-switch{scroll-behavior:auto}}
/* the admin console now lives in Settings (profile menu); never show it as a pill */
html[data-theme] .wb-header nav.page-switch a.wb-admin-link,html[data-theme] .wb-header nav.page-switch a[href^="/admin"]{display:none!important}
/* header sits in the content column: same left/right edges as the page content at every width, scrollbar or not.
   (macos.css made it 100vw full-bleed, which ignores the scrollbar; the divider is the site's .5px --mac-sep rule.) */
html[data-theme] main.shell>nav.wb-header{margin-left:0!important;margin-right:0!important;width:auto!important;padding-left:0!important;padding-right:0!important;box-sizing:border-box}
/* live-refresh dot sits inside the O of WORKBOARD in the header (placed by wb-dot-in-o.js); hidden until placed */
html[data-theme] #wb-live-dot{visibility:hidden}
html[data-theme] #wb-live-dot.wb-in-o{visibility:visible;display:block!important;position:fixed!important;right:auto!important;bottom:auto!important;opacity:1!important;z-index:60!important;box-shadow:0 0 3px var(--mac-green,#34c759)!important;pointer-events:auto}
html[data-theme] #wb-live-dot.wb-in-o[style*="96, 165, 250"]{background:#0a84ff!important;box-shadow:0 0 3px #0a84ff!important}
/* lucid glass header: fully translucent, blurs whatever scrolls under it (dark and light) */
html[data-theme] main.shell>nav.wb-header{--wb-glass:rgba(40,40,44,.34);background:var(--wb-glass)!important;-webkit-backdrop-filter:saturate(200%) blur(28px)!important;backdrop-filter:saturate(200%) blur(28px)!important;border-bottom:.5px solid rgba(255,255,255,.12)!important;box-shadow:inset 0 .5px 0 rgba(255,255,255,.10)}
html[data-theme="light"] main.shell>nav.wb-header{--wb-glass:rgba(255,255,255,.42);border-bottom-color:rgba(60,60,67,.16)!important;box-shadow:inset 0 .5px 0 rgba(255,255,255,.7)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){html[data-theme] main.shell>nav.wb-header{background:var(--mac-material)!important}}
/* body must not be its own scroller (html already clips x), otherwise the sticky header never sticks */
html[data-theme] body{overflow:visible!important}
