/* The app's window (owner 11.11): the right-click menu (context-menu.js) and, in the installed app with the title bar
   tucked away (window controls overlay, the arrow in Chrome's or Edge's title bar), a slim title bar of our own that drags
   the window. Loaded after every other sheet; both looks set here (not in the generated ui-dark.css). */

/* ---- the right-click menu ---- */
.ws-menu{position:fixed;inset:auto;margin:0;min-width:210px;max-width:min(300px,calc(100vw - 8px));padding:6px;border-radius:12px;display:flex;flex-direction:column;gap:1px;
  font:500 14px/1.25 'Source Sans 3','Segoe UI',system-ui,sans-serif;z-index:2147483600;outline:none;
  -webkit-backdrop-filter:blur(18px) saturate(160%);backdrop-filter:blur(18px) saturate(160%)}
html:not([data-look="dark"]) .ws-menu{background:rgba(255,255,255,.94);color:#14202c;border:1px solid #d3dbe1;box-shadow:0 18px 44px -14px rgba(20,32,44,.35)}
html[data-look="dark"] .ws-menu{background:rgba(21,32,42,.96);color:#e8eef4;border:1px solid rgba(255,255,255,.12);box-shadow:0 18px 44px -12px rgba(0,0,0,.6)}
.ws-menu-item{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;cursor:pointer;white-space:nowrap}
.ws-menu-item[role="menuitemradio"]::before{content:"";width:8px;height:8px;border-radius:50%;border:1.5px solid currentColor;opacity:.55;flex:none}
.ws-menu-item[aria-checked="true"]::before{background:currentColor;opacity:1}
html:not([data-look="dark"]) .ws-menu-item:is(:hover,:focus-visible,:focus){background:#e3eef0;color:#0b5560}
html[data-look="dark"] .ws-menu-item:is(:hover,:focus-visible,:focus){background:rgba(95,211,214,.16);color:#bff2f3}
.ws-menu-sep{height:1px;margin:5px 4px;background:currentColor;opacity:.12}
.ws-menu-head{padding:6px 10px 2px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;opacity:.6}
.ws-menu-hint{padding:6px 10px 2px;font-size:12px;opacity:.55;white-space:nowrap}
@media (prefers-reduced-transparency:reduce){.ws-menu{-webkit-backdrop-filter:none;backdrop-filter:none}}

/* ---- the title bar of the installed app (window controls overlay) ---- */
#ws-titlebar{display:none}
@media (display-mode:window-controls-overlay){
  :root{--tb:env(titlebar-area-height,0px)}
  #ws-titlebar{display:flex;position:fixed;left:env(titlebar-area-x,0);top:env(titlebar-area-y,0);width:env(titlebar-area-width,100%);height:env(titlebar-area-height,33px);
    align-items:center;gap:8px;padding:0 12px;box-sizing:border-box;font:600 13px/1 'Source Sans 3','Segoe UI',system-ui,sans-serif;letter-spacing:.01em;
    -webkit-app-region:drag;app-region:drag;user-select:none;z-index:2147482000}
  #ws-titlebar img{width:18px;height:18px;border-radius:4px}
  html:not([data-look="dark"]) #ws-titlebar{background:#e4ebf1;color:#14202c}
  html[data-look="dark"] #ws-titlebar{background:#0b1117;color:#c9d4de}
  /* Everything starts under the bar. */
  body{padding-top:var(--tb)}
  html[data-look] body .rail{top:calc(12px + var(--tb));height:calc(100dvh - 24px - var(--tb))}
  body #cortex-root,body #world-root{height:calc(100dvh - var(--cx-top,74px) - var(--tb))}
  html[data-look] body #detail-dialog.pane{top:calc(12px + var(--tb));height:calc(100dvh - 24px - var(--tb))}
  /* Whole-screen blocks are one bar shorter, or the bottom of the page slides under the taskbar (owner 12.11). */
  body .app-shell,body .shell{min-height:calc(100dvh - var(--tb))}
  body.signed-out main#main,body .landing{min-height:calc(100dvh - var(--tb))}
}
@media print{#ws-titlebar,.ws-menu{display:none!important}}
