/* Shared material layer: translucent chrome, calm content, no animated blur. */
:root {
  --glass-surface: linear-gradient(135deg, #ffffffb8, #f7fbff66 48%, #ffffff8a);
  --glass-edge: #ffffffb8;
  --glass-shadow: 0 12px 36px #233e571f, inset 0 1px 0 #fffffff0, inset 0 -1px 0 #ffffff60;
}
.ambient {
  background: radial-gradient(ellipse at 14% 8%, #f8f0e7 0, transparent 48%),
    radial-gradient(ellipse at 88% 22%, #b6d8e5 0, transparent 46%),
    radial-gradient(ellipse at 30% 100%, #6e9da9 0, transparent 56%),
    linear-gradient(140deg, #dee8ee, #abc5d2 70%, #90aebe);
}
.menubar {
  background: #f6fbff52;
  border-bottom: 1px solid #ffffff80;
  box-shadow: 0 1px 8px #26435508, inset 0 1px 0 #ffffff80;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.desktop-session .app-window.window {
  border-radius: 16px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-surface);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  box-shadow: 0 16px 50px #1c3c5526, inset 0 1px 0 #fff, inset 0 -1px 0 #ffffff85;
}
.desktop-session .app-window.frontmost {
  box-shadow: 0 30px 80px #17344836, 0 6px 20px #17344814,
    inset 0 1px 0 #fff, inset 0 -1px 0 #ffffffa0;
}
.desktop-session .app-window.maximized {border-radius:0;}
.window-titlebar {
  height:36px;flex-basis:36px;padding:0 10px;gap:8px;
  background:linear-gradient(180deg,#ffffff8c,#f4f9ff38);
  border-bottom:1px solid #7291a419;
  box-shadow:inset 0 1px 0 #ffffffdc;
}
.window-titlebar strong {font-size:12px;letter-spacing:.01em;color:#2b4050;}
.window-controls {gap:1px;margin-right:10px;align-items:center;}
.window-controls button {
  position:relative;isolation:isolate;width:28px;height:32px;
  border:0;border-radius:10px;background:transparent!important;
  color:#52201d;box-shadow:none;transition:transform 100ms ease;
}
.window-controls button::before {
  content:"";position:absolute;z-index:-1;width:16px;height:16px;border-radius:50%;
  background:linear-gradient(160deg,#ff9c91,#ff645c 48%,#ed4945);
  box-shadow:inset 0 1px 1px #ffffff8c,inset 0 -1px 1px #8f24242a,0 0 0 .5px #bc3c3c55,0 2px 3px #3b283015;
}
.window-controls button:nth-child(2) {color:#6e470b;}
.window-controls button:nth-child(2)::before {background:linear-gradient(160deg,#ffe49b,#ffc34a 48%,#f5aa25);box-shadow:inset 0 1px 1px #ffffffa0,inset 0 -1px 1px #91610c22,0 0 0 .5px #b57a2550,0 2px 3px #3b283015;}
.window-controls button:nth-child(3) {color:#12592a;}
.window-controls button:nth-child(3)::before {background:linear-gradient(160deg,#94e9a6,#48d06b 48%,#29b44d);box-shadow:inset 0 1px 1px #ffffff9c,inset 0 -1px 1px #206b2b26,0 0 0 .5px #2b8f4550,0 2px 3px #3b283015;}
.window-controls svg {width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round;opacity:.68;pointer-events:none;}
.window-controls:hover svg,.window-controls button:focus-visible svg {opacity:1;}
.window-controls button:hover {background:#ffffff50!important;}
.window-controls button:active {transform:scale(.88);}
.window-controls button:focus-visible,.window-reset:focus-visible {outline:2px solid #437ba8;outline-offset:1px;}
.window-controls .restore-symbol {display:none;}
.maximized .window-controls .restore-symbol {display:initial;}
.maximized .window-controls .expand-symbol {display:none;}
.window-reset {width:30px;height:30px;border-radius:10px;display:grid;place-items:center;}
.window-reset:hover {background:#ffffff70;}
.window-reset svg {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.4;pointer-events:none;}
.app-window:not(.frontmost) .window-titlebar {opacity:.82;}
.app-window iframe {background:transparent;}
body.app-frame {background:#f6f9fc99;color:#2b4050;}
#dock {
  background:linear-gradient(150deg,#ffffffb5,#f0f8ff55 55%,#ffffff80);
  backdrop-filter:blur(28px) saturate(175%);-webkit-backdrop-filter:blur(28px) saturate(175%);
  border:1px solid #ffffffb8;border-radius:28px;
  box-shadow:0 16px 46px #1c3c5529,inset 0 1px 1px #fff,inset 0 -1px 1px #ffffffa0;
}
#dock button {transition:transform 120ms ease;}
#dock button svg {filter:drop-shadow(0 3px 3px #25465c22);}
#context-menu, #spaces-dialog {background:linear-gradient(135deg,#fffffff2,#f0f6fbe8);border:1px solid #fff;box-shadow:var(--glass-shadow);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border-radius:18px;}
.app-frame #view > section > nav {
  padding:5px;border:1px solid #ffffffb3;border-radius:18px;background:#ffffff4d;
  box-shadow:inset 0 1px 0 #ffffffc4,0 3px 10px #26435508;
}
.app-frame #view > section > nav button {border-radius:13px;transition:background 100ms ease,box-shadow 100ms ease;}
.app-frame #view > section > nav button[aria-selected=true] {
  background:linear-gradient(165deg,#fffffff5,#ffffffa8);color:#28485d;
  box-shadow:0 2px 6px #25465c14,inset 0 1px 0 white;
}
.app-frame #view .panel {background:#ffffff9c;border-color:#ffffffc7;box-shadow:inset 0 1px 0 #fff,0 5px 18px #25465c06;border-radius:20px;}
@media (max-width:720px) {
  .desktop-session .app-window.window {border-radius:0;}
  .window-titlebar {height:38px;flex-basis:38px;padding:0 8px;}
  .window-controls button {width:34px;height:34px;}
  .window-controls button::before {width:19px;height:19px;}
  .window-controls svg {width:16px;height:16px;opacity:.9;}
  #dock {border-radius:24px;}
}
@media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {
  .desktop-session .app-window.window,.menubar,#dock,#context-menu,#spaces-dialog {background:#edf3f8;backdrop-filter:none;-webkit-backdrop-filter:none;}
  body.app-frame {background:#f5f8fb;}
  .app-frame #view .panel,.app-frame #view > section > nav {background:#fff;border-color:#a6b6c3;}
}
@media (prefers-reduced-motion:reduce) {
  .window-controls button,#dock button,.app-frame #view > section > nav button {transition:none;}
}

/* The viewport-sized containing block remains stable while refraction is active. */
#desktop-scene {position:fixed;inset:0;isolation:isolate;overflow:hidden;}

/* Compact desktop chrome; window bounds read the actual menu height. */
.menubar {height:32px;padding:0 18px;}
.menubar .spaces {padding:0;}
.menubar .spaces button {padding:4px 10px;line-height:20px;}
.menubar .spaces > button {padding:2px 8px;}
#launcher {top:32px;}
.window-app-icon svg {width:19px;height:19px;}
@media(max-width:720px){
 .menubar {height:36px;padding:0 10px;}
 .menubar .spaces button {padding:5px 8px;}
 #launcher {top:36px;}
}

/* Maximized windows share their chrome with the desktop menu. */
#maximized-window-bar{display:flex;align-items:center;gap:7px;min-width:0;max-width:40%;}
#maximized-window-bar[hidden],#desktop-brand[hidden]{display:none;}
#maximized-window-bar .window-controls{gap:0;margin-right:3px;flex:none;}
#maximized-window-bar .window-controls button{height:28px;width:26px;}
#maximized-window-bar strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#maximized-window-bar .window-app-icon{flex:none;}
#maximized-window-bar .expand-symbol{display:none;}
#maximized-window-bar .restore-symbol{display:initial;}
.app-window.menu-integrated > .window-titlebar{display:none;}
@media(max-width:720px){
 #maximized-window-bar{max-width:36%;gap:4px;}
 #maximized-window-bar .window-controls button{width:28px;height:32px;}
 #maximized-window-bar .window-controls [data-command=maximize]{display:none;}
 #maximized-window-bar .window-app-icon{display:none;}
 .menubar .menu-status{gap:4px;}
}
