@layer shell {
  #az-root { position:fixed; inset:0; overflow:hidden; }
  .az-shell { position:absolute; inset:0; display:grid; grid-template-rows:34px minmax(0,1fr) 92px; isolation:isolate; }
  .az-system-bar { z-index:700; display:flex; align-items:center; gap:7px; min-width:0; padding:0 max(12px,env(safe-area-inset-left)); color:#172033; border-bottom:1px solid rgba(255,255,255,.5); background:rgba(250,252,255,.56); box-shadow:0 1px 14px rgba(45,58,82,.07); backdrop-filter:blur(24px) saturate(150%); -webkit-backdrop-filter:blur(24px) saturate(150%); }
  .az-brand-button,.az-system-menu button,.az-system-action { border:0; background:transparent; color:inherit; cursor:pointer; transition:background var(--az-motion-fast),transform var(--az-motion-fast); }
  .az-brand-button:hover,.az-system-menu button:hover,.az-system-action:hover { background:rgba(255,255,255,.5); }
  .az-brand-button:active,.az-system-menu button:active,.az-system-action:active { transform:translateY(1px); }
  .az-brand-button { min-height:30px; display:inline-flex; align-items:center; gap:7px; padding:2px 8px 2px 4px; border-radius:8px; }
  .az-brand-button img { width:21px; height:21px; }
  .az-brand-button strong { font-size:13px; font-weight:730; letter-spacing:-.015em; }
  .az-system-menu { display:flex; align-items:center; gap:1px; }
  .az-system-menu button { min-height:28px; padding:0 8px; border-radius:7px; font-size:12px; font-weight:540; }
  .az-system-spacer { flex:1; }
  .az-system-actions { display:flex; align-items:center; gap:2px; }
  .az-system-action { width:30px; height:30px; display:grid; place-items:center; border-radius:8px; }
  .az-system-action svg { width:15px; height:15px; }
  .az-local-state { margin-right:4px; padding:4px 7px; border:1px solid rgba(50,70,100,.1); border-radius:999px; background:rgba(255,255,255,.34); color:#466170; font:700 11px/1 var(--az-font-mono); letter-spacing:.05em; }
  .az-clock { min-width:49px; margin-left:2px; text-align:right; color:#29364a; font:600 11px/1 var(--az-font-ui); }
  .az-stage { position:relative; min-height:0; overflow:hidden; }
  .az-home-scroll { position:absolute; inset:0; overflow:hidden; }
  .az-desktop { position:relative; width:100%; min-height:100%; }
  .az-desktop-signature { position:absolute; top:28px; left:30px; display:flex; flex-direction:column; color:rgba(24,39,67,.66); text-shadow:0 1px 10px rgba(255,255,255,.72); }
  .az-desktop-signature strong { font-size:clamp(28px,2.5vw,40px); font-weight:760; letter-spacing:-.045em; }
  .az-desktop-signature span { margin-top:-2px; font-size:12px; font-weight:570; letter-spacing:.02em; }
  .az-desktop-shortcuts { position:absolute; top:24px; right:24px; display:grid; grid-template-columns:repeat(2,94px); grid-auto-rows:98px; gap:8px 10px; justify-items:center; }
  .az-desktop-shortcut { width:90px; min-height:90px; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:6px; padding:5px 4px; border:0; border-radius:13px; background:transparent; color:#162337; text-align:center; cursor:default; transition:background var(--az-motion-fast),transform var(--az-motion-fast); }
  .az-desktop-shortcut:hover { background:rgba(255,255,255,.26); }
  .az-desktop-shortcut:active { transform:scale(.97); }
  .az-desktop-icon { width:58px; height:58px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.72); border-radius:17px; background:linear-gradient(145deg,rgba(255,255,255,.82),rgba(235,242,251,.66)); box-shadow:0 10px 24px rgba(45,60,86,.15),inset 0 1px rgba(255,255,255,.75); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); }
  .az-desktop-icon img { width:36px; height:36px; filter:drop-shadow(0 3px 4px rgba(30,40,60,.1)); }
  .az-world-shortcut .az-desktop-icon[data-accent="brass"] { background:linear-gradient(145deg,rgba(255,242,213,.94),rgba(231,190,126,.76)); }
  .az-world-shortcut .az-desktop-icon[data-accent="rust"] { background:linear-gradient(145deg,rgba(255,227,216,.94),rgba(221,142,112,.76)); }
  .az-world-shortcut .az-desktop-icon[data-accent="teal"] { background:linear-gradient(145deg,rgba(219,248,246,.94),rgba(111,192,190,.76)); }
  .az-desktop-label { max-width:88px; padding:2px 5px; border-radius:6px; color:#142033; font-size:11px; font-weight:650; line-height:1.2; text-shadow:0 1px 3px rgba(255,255,255,.9); }
  .az-session-widget { position:absolute; left:28px; bottom:22px; width:min(360px,calc(100vw - 290px)); min-height:132px; display:grid; grid-template-columns:54px minmax(0,1fr); gap:14px; padding:16px 17px; border:1px solid rgba(255,255,255,.7); border-radius:21px; background:rgba(250,252,255,.46); box-shadow:var(--az-shadow-soft); backdrop-filter:blur(28px) saturate(145%); -webkit-backdrop-filter:blur(28px) saturate(145%); }
  .az-session-orb { width:50px; height:50px; border-radius:17px; background:radial-gradient(circle at 33% 28%,rgba(255,255,255,.96) 0 5%,transparent 6%),linear-gradient(145deg,#7081ef 0%,#63a8d4 46%,#efa98f 100%); box-shadow:inset 0 1px rgba(255,255,255,.82),0 10px 24px rgba(62,79,132,.18); }
  .az-session-copy { min-width:0; }
  .az-eyebrow { display:block; color:#65748a; font:700 11px/1.3 var(--az-font-mono); letter-spacing:.07em; text-transform:uppercase; }
  .az-session-widget h1 { margin:4px 0 3px; color:#1a2740; font:660 18px/1.15 var(--az-font-ui); letter-spacing:-.02em; }
  .az-session-widget p { margin:0; color:#536178; font-size:12px; line-height:1.45; }
  .az-session-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:10px; }
  .az-aizo-card {
    position:absolute;
    left:28px;
    bottom:22px;
    width:min(410px,calc(100vw - 290px));
    min-width:0;
    padding:17px;
    border:1px solid rgba(255,255,255,.74);
    border-radius:21px;
    background:linear-gradient(145deg,rgba(251,253,255,.62),rgba(232,239,251,.45));
    box-shadow:var(--az-shadow-soft),inset 0 1px rgba(255,255,255,.8);
    color:#1a2740;
    backdrop-filter:blur(28px) saturate(145%);
    -webkit-backdrop-filter:blur(28px) saturate(145%);
  }
  .az-phone-aizo-card,.az-tablet-aizo-card { display:none; }
  .az-aizo-kicker { display:block;color:#5f6e84;font:750 10px/1.3 var(--az-font-mono);letter-spacing:.1em; }
  .az-aizo-card h2 { margin:5px 0;color:#18263d;font:700 19px/1.08 var(--az-font-ui);letter-spacing:-.025em; }
  .az-aizo-card > p { margin:0;color:#58667c;font-size:12px;line-height:1.45; }
  .az-aizo-actions { display:flex;flex-wrap:wrap;gap:7px;margin-top:12px; }
  .az-aizo-action { min-height:44px;display:inline-flex;align-items:center;padding:8px 11px;border:1px solid rgba(52,70,99,.16);border-radius:12px;background:rgba(255,255,255,.5);color:#2c3a52;font-size:11px;font-weight:730;line-height:1.25;text-decoration:none; }
  .az-aizo-action-primary { border-color:transparent;background:#2e3e65;color:#fff;box-shadow:0 7px 16px rgba(42,57,92,.16); }
  .az-aizo-action:hover,.az-aizo-action:focus-visible { transform:translateY(-1px);text-decoration:underline;text-underline-offset:3px; }
  .az-aizo-email { display:inline-block;max-width:100%;margin-top:8px;color:#65748a;font:600 11px/1.4 var(--az-font-mono);overflow-wrap:anywhere;text-underline-offset:3px; }
  .az-task-shelf-wrap { z-index:800; display:flex; align-items:flex-start; justify-content:center; padding:6px 16px max(10px,env(safe-area-inset-bottom)); pointer-events:none; }
  .az-task-shelf { pointer-events:auto; min-height:70px; max-width:min(1040px,calc(100vw - 26px)); display:flex; align-items:flex-end; justify-content:center; gap:3px; padding:6px 8px; border:1px solid rgba(255,255,255,.74); border-radius:23px; background:rgba(248,251,255,.5); box-shadow:var(--az-shadow-float),inset 0 1px rgba(255,255,255,.76); backdrop-filter:blur(30px) saturate(155%); -webkit-backdrop-filter:blur(30px) saturate(155%); }
  .az-shelf-pinned,.az-shelf-running { display:flex; align-items:flex-end; gap:3px; }
  .az-shelf-button { --az-dock-scale:1; --az-dock-lift:0px; position:relative; width:56px; height:56px; flex:0 0 56px; display:grid; place-items:center; padding:7px; border:0; border-radius:15px; background:transparent; cursor:pointer; transition:background var(--az-motion-fast); }
  .az-shelf-button:hover { background:rgba(255,255,255,.45); }
  .az-shelf-button > svg,.az-shelf-button > img { pointer-events:none; transform:translateY(calc(-1 * var(--az-dock-lift))) scale(var(--az-dock-scale)); transform-origin:50% 100%; transition:transform 120ms ease-out; will-change:transform; }
  .az-shelf-button > svg { width:27px; height:27px; color:#22304a; }
  .az-shelf-button > img { width:39px; height:39px; filter:drop-shadow(0 4px 6px rgba(35,49,75,.16)); }
  .az-shelf-button.is-launching > img,.az-shelf-button.is-launching > svg { animation:az-dock-bounce 420ms cubic-bezier(.2,.75,.25,1); }
  @keyframes az-dock-bounce { 0%,100%{transform:translateY(0)}45%{transform:translateY(-17px)}70%{transform:translateY(-5px)} }
  .az-shelf-button.is-open::after { content:""; position:absolute; bottom:1px; left:50%; width:5px; height:5px; border-radius:50%; background:#5364d6; transform:translateX(-50%); box-shadow:0 0 0 2px rgba(255,255,255,.58); }
  .az-shelf-button.is-active::after { width:15px; border-radius:999px; }
  .az-shelf-divider { width:1px; height:41px; margin:0 4px 6px; background:rgba(48,61,84,.17); }
  .az-dock-tooltip { position:absolute; left:50%; bottom:calc(100% + 10px); max-width:180px; padding:6px 9px; border:1px solid rgba(255,255,255,.75); border-radius:9px; background:rgba(252,253,255,.84); box-shadow:0 7px 20px rgba(42,55,80,.18); color:#27344a; font-size:11px; font-weight:620; white-space:nowrap; opacity:0; pointer-events:none; transform:translate(-50%,4px); transition:opacity var(--az-motion-fast),transform var(--az-motion-fast); backdrop-filter:blur(16px); }
  .az-shelf-button:hover .az-dock-tooltip,.az-shelf-button:focus-visible .az-dock-tooltip { opacity:1; transform:translate(-50%,0); }
  .az-window-layer { position:absolute; inset:0; z-index:200; pointer-events:none; }
  .az-fullscreen-layer { position:fixed; inset:0; z-index:1000; pointer-events:none; }
  .az-fullscreen-layer:has(.az-fullscreen-app) { pointer-events:auto; }
  .az-fullscreen-app { position:absolute; inset:0; display:flex; flex-direction:column; overflow:hidden; background:#0b0d13; color:#e8edf5; pointer-events:auto; }
  .az-fullscreen-app:focus { outline:none; }
  .az-fullscreen-body { position:relative; min-height:0; flex:1; overflow:hidden; }
  .az-window { position:absolute; min-width:420px; min-height:300px; overflow:hidden; display:flex; flex-direction:column; border:1px solid rgba(255,255,255,.88); border-radius:var(--az-radius-window); background:rgba(248,250,253,.92); box-shadow:var(--az-shadow-window); pointer-events:auto; opacity:.94; transform:scale(.995); transition:opacity var(--az-motion),transform var(--az-motion),box-shadow var(--az-motion),border-radius var(--az-motion); }
  .az-window.is-active { opacity:1; transform:none; box-shadow:0 34px 86px rgba(43,54,78,.27),0 7px 22px rgba(43,54,78,.12); }
  .az-window.is-minimized { display:none; }
  .az-window.is-maximized { inset:8px !important; width:auto !important; height:auto !important; border-radius:15px; }
  .az-window-bar { position:relative; height:var(--az-titlebar); flex:0 0 var(--az-titlebar); display:flex; align-items:center; gap:8px; padding:0 48px 0 14px; border-bottom:1px solid rgba(35,50,75,.08); background:rgba(249,251,254,.86); user-select:none; touch-action:none; backdrop-filter:blur(26px) saturate(145%); -webkit-backdrop-filter:blur(26px) saturate(145%); }
  .az-window-icon { width:19px; height:19px; }
  .az-window-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#28354a; font-size:12px; font-weight:650; }
  .az-window-context { display:none; }
  .az-window-controls { order:-1; display:flex; gap:8px; align-items:center; margin-right:5px; }
  .az-window-control { width:13px; height:13px; display:grid; place-items:center; padding:0; border:1px solid rgba(0,0,0,.08); border-radius:50%; color:transparent; font-size:0; line-height:1; cursor:pointer; transition:filter var(--az-motion-fast),transform var(--az-motion-fast); }
  .az-window-control:hover { filter:brightness(.94); transform:scale(1.06); }
  .az-window-control[data-action="close"] { order:1; background:#ff6158; }
  .az-window-control[data-action="minimize"] { order:2; background:#ffbd2e; }
  .az-window-control[data-action="maximize"] { order:3; background:#28c840; }
  .az-window-control[data-action="menu"] { position:absolute; top:8px; right:8px; order:4; width:34px; height:32px; border:0; border-radius:9px; background:transparent; color:#617087; font-size:17px; letter-spacing:1px; }
  .az-window-control[data-action="menu"]:hover { background:rgba(60,76,103,.08); transform:none; filter:none; }
  .az-window-body { min-height:0; flex:1; overflow:auto; background:#f7f9fc; color:var(--az-text); }
  .az-resize-handle { position:absolute; z-index:6; opacity:0; }
  .az-resize-handle[data-edge="n"],.az-resize-handle[data-edge="s"] { left:12px; right:12px; height:8px; cursor:ns-resize; }
  .az-resize-handle[data-edge="n"] { top:-3px; }
  .az-resize-handle[data-edge="s"] { bottom:-3px; }
  .az-resize-handle[data-edge="e"],.az-resize-handle[data-edge="w"] { top:12px; bottom:12px; width:8px; cursor:ew-resize; }
  .az-resize-handle[data-edge="e"] { right:-3px; }
  .az-resize-handle[data-edge="w"] { left:-3px; }
  .az-resize-handle[data-edge="ne"],.az-resize-handle[data-edge="nw"],.az-resize-handle[data-edge="se"],.az-resize-handle[data-edge="sw"] { width:14px; height:14px; }
  .az-resize-handle[data-edge="ne"] { top:-4px; right:-4px; cursor:nesw-resize; }
  .az-resize-handle[data-edge="nw"] { top:-4px; left:-4px; cursor:nwse-resize; }
  .az-resize-handle[data-edge="se"] { bottom:-4px; right:-4px; cursor:nwse-resize; }
  .az-resize-handle[data-edge="sw"] { bottom:-4px; left:-4px; cursor:nesw-resize; }
  .az-desktop-context { position:fixed; z-index:1100; width:210px; display:none; padding:6px; border:1px solid rgba(255,255,255,.76); border-radius:13px; background:rgba(248,251,255,.78); box-shadow:0 16px 42px rgba(42,54,78,.22),inset 0 1px rgba(255,255,255,.8); backdrop-filter:blur(26px) saturate(145%); -webkit-backdrop-filter:blur(26px) saturate(145%); }
  .az-desktop-context.is-open { display:grid; gap:2px; }
  .az-desktop-context button { min-height:36px; padding:7px 10px; border:0; border-radius:8px; background:transparent; color:#26344b; font-size:12px; text-align:left; cursor:pointer; }
  .az-desktop-context button:hover,.az-desktop-context button:focus-visible { background:rgba(89,105,220,.11); }
  .az-context-divider { height:1px; margin:3px 5px; background:rgba(44,59,84,.11); }
  .az-reduce-motion .az-shelf-button > img,.az-reduce-motion .az-shelf-button > svg { transition:none; transform:none !important; }

  @media (pointer:coarse) {
    .az-brand-button { min-height:44px; }
    .az-system-menu button { min-height:44px; }
    .az-system-action { width:44px; height:44px; }
    .az-window-control { width:44px; height:44px; border:0; background:transparent !important; }
    .az-window-control::before { content:""; width:14px; height:14px; border-radius:50%; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); }
    .az-window-control[data-action="close"]::before { background:#ff6158; }
    .az-window-control[data-action="minimize"]::before { background:#ffbd2e; }
    .az-window-control[data-action="maximize"]::before { background:#28c840; }
    .az-window-control[data-action="menu"] { width:44px; height:44px; top:2px; }
  }

  @media (max-width:1199px) {
    .az-shell { grid-template-rows:42px minmax(0,1fr) 82px; }
    .az-system-bar { padding-inline:12px; }
    .az-desktop-shortcuts { top:20px; right:18px; grid-template-columns:repeat(2,90px); }
    .az-session-widget { left:20px; bottom:22px; width:min(360px,calc(100vw - 240px)); }
    .az-window { left:3% !important; top:3% !important; width:94% !important; height:94% !important; min-width:0; min-height:0; }
    .az-window-bar { height:var(--az-titlebar-touch); flex-basis:var(--az-titlebar-touch); }
    .az-resize-handle { display:none; }
  }
  @media (max-width:839px) {
    .az-system-menu button:nth-child(3),.az-system-menu button:nth-child(4) { display:none; }
    .az-home-scroll { overflow:auto; }
    .az-desktop { min-height:max(100%,700px); padding:18px 18px 110px; }
    .az-desktop-signature { position:static; margin:6px 4px 18px; }
    .az-desktop-shortcuts { position:static; display:grid; grid-template-columns:repeat(3,minmax(84px,1fr)); grid-auto-rows:auto; gap:8px; justify-items:center; }
    .az-session-widget { position:static; width:min(100%,500px); margin:24px auto 0; }
  }
  @media (max-width:599px), (max-height:500px) and (max-width:899px) {
    .az-shell { grid-template-rows:48px minmax(0,1fr) var(--az-bottom-nav); }
    .az-system-bar { padding-left:max(8px,env(safe-area-inset-left)); padding-right:max(8px,env(safe-area-inset-right)); }
    .az-brand-button { min-height:44px; }
    .az-brand-button strong { font-size:12px; }
    .az-system-menu { display:none; }
    .az-local-state { display:none; }
    .az-system-action { width:44px; height:44px; }
    .az-clock { min-width:44px; font-size:11px; }
    .az-desktop { min-height:max(100%,720px); padding:16px 12px 92px; }
    .az-desktop-signature { margin:0 7px 16px; }
    .az-desktop-signature strong { font-size:28px; }
    .az-desktop-shortcuts { grid-template-columns:repeat(3,minmax(84px,1fr)); }
    .az-desktop-shortcut { width:88px; min-height:88px; }
    .az-desktop-icon { width:54px; height:54px; }
    .az-session-widget { grid-template-columns:46px minmax(0,1fr); gap:12px; padding:14px; border-radius:18px; }
    .az-session-orb { width:44px; height:44px; border-radius:15px; }
    .az-session-widget h1 { font-size:17px; }
    .az-session-widget p { font-size:12px; }
    .az-task-shelf-wrap { padding:4px 8px max(6px,env(safe-area-inset-bottom)); }
    .az-task-shelf { width:100%; min-height:58px; max-width:none; gap:1px; padding:4px 5px; border-radius:17px; overflow-x:auto; justify-content:flex-start; scrollbar-width:none; }
    .az-task-shelf::-webkit-scrollbar { display:none; }
    .az-shelf-button { width:48px; height:48px; flex-basis:48px; padding:6px; }
    .az-shelf-button > img { width:34px; height:34px; }
    .az-shelf-button > svg { width:25px; height:25px; }
    .az-shelf-divider { height:33px; margin-bottom:7px; }
    .az-dock-tooltip { display:none; }
    .az-window { left:0 !important; top:0 !important; width:100% !important; height:100% !important; min-width:0; min-height:0; border:0; border-radius:0; transform:none !important; }
    .az-window.is-maximized { inset:0 !important; border-radius:0; }
    .az-window-bar { height:54px; flex-basis:54px; padding:0 48px 0 8px; }
    .az-window-icon { width:20px; height:20px; }
    .az-window-controls { margin-right:0; gap:0; }
    .az-window-control[data-action="minimize"],.az-window-control[data-action="maximize"] { display:none; }
    .az-window-control[data-action="close"] { width:44px; height:44px; border:0; background:transparent; }
    .az-window-control[data-action="close"]::before { content:""; width:14px; height:14px; border-radius:50%; background:#ff6158; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); }
    .az-window-control[data-action="menu"] { top:5px; right:4px; width:44px; height:44px; }
    .az-desktop-context { display:none !important; }
  }


  /* Per-app shell finalization previously lived in tool-windows.css; it is part of shell ownership. */

  /* Calculator, Winamp and Arcade are objects of their own. The OS still owns
     lifecycle/focus/routing, but it does not draw a second visible frame. */
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) {
    overflow:visible;
    border:0;
    border-radius:22px;
    background:transparent;
    box-shadow:none;
  }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]).is-active { box-shadow:none; }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-bar {
    position:absolute;
    top:8px;
    right:8px;
    z-index:45;
    width:34px;
    height:34px;
    min-height:0;
    flex:0 0 auto;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
    pointer-events:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-icon,
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-title,
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-context,
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-control:not([data-action="close"]),
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-resize-handle {
    display:none;
  }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-controls {
    width:34px;
    height:34px;
    margin:0;
    gap:0;
    pointer-events:auto;
  }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-control[data-action="close"] {
    position:relative;
    width:32px;
    height:32px;
    display:grid;
    place-items:center;
    overflow:hidden;
    padding:0;
    border:1px solid rgba(255,255,255,.52);
    border-radius:50%;
    appearance:none;
    background:rgba(17,25,40,.86) !important;
    box-shadow:0 7px 22px rgba(13,20,34,.2);
    color:transparent !important;
    font-size:0 !important;
    pointer-events:auto;
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-control[data-action="close"]::before,
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-control[data-action="close"]::after {
    content:'';
    position:absolute;
    left:50%;
    top:50%;
    width:13px;
    height:2px;
    border-radius:999px;
    background:#fff;
    transform-origin:center;
  }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-control[data-action="close"]::before { transform:translate(-50%,-50%) rotate(45deg); }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-control[data-action="close"]::after { transform:translate(-50%,-50%) rotate(-45deg); }
  .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-body {
    min-height:100%;
    overflow:hidden;
    border-radius:22px;
    background:transparent;
    box-shadow:0 24px 64px rgba(35,47,72,.2);
  }

  /* Keep the desktop useful without turning it into a second Applications grid. */
  @media (min-width:1200px) {
    .az-desktop-shortcuts {
      top:20px;
      right:20px;
      grid-template-columns:repeat(3,84px);
      grid-auto-rows:88px;
      gap:5px 6px;
    }
    .az-desktop-shortcut {
      width:82px;
      min-height:82px;
      gap:5px;
      padding:4px 3px;
    }
    .az-desktop-icon {
      width:52px;
      height:52px;
      border-radius:15px;
    }
    .az-desktop-icon img { width:32px;height:32px; }
    .az-desktop-label { max-width:80px;font-size:11px; }
  }

  /* Camera remains an OS window, just a calmer and more appropriately sized one.
     First-run geometry is owned by main.js so user-resized windows remain respected. */
  .az-window[data-app-id="camera"] .az-camera-shell { align-items:center; }
  .az-window[data-app-id="camera"] .az-camera {
    width:min(100%,760px);
    gap:10px;
    padding:12px;
  }
  .az-window[data-app-id="camera"] .az-camera-stage {
    width:100%;
    min-height:0;
    max-height:400px;
    aspect-ratio:4/3;
  }
  .az-window[data-app-id="camera"] .az-camera-video {
    min-height:0;
    height:100%;
  }
  .az-window[data-app-id="camera"] .az-camera-gallery {
    grid-template-columns:repeat(auto-fill,minmax(100px,1fr));
  }

  /* A running Arcade game is a page inside Arcade, not a card beneath the library. */
  .az-arcade { position:relative; }
  .az-game-stage:not([hidden]) {
    position:absolute;
    inset:0;
    z-index:20;
    overflow:auto;
    padding:clamp(14px,2.5vw,26px);
    background:radial-gradient(circle at 85% 0,rgba(102,126,255,.2),transparent 30%),linear-gradient(145deg,#0d1423,#070b13 74%);
  }
  .az-arcade-session {
    width:100%;
    min-height:100%;
    display:flex;
    flex-direction:column;
    gap:16px;
  }
  .az-arcade-session-head {
    min-height:58px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:14px;
    padding:0 0 14px;
    border-bottom:1px solid rgba(169,188,225,.16);
  }
  .az-arcade-session-head h3 {
    margin:2px 0 0;
    color:#f4f7ff;
    font:720 clamp(24px,3vw,36px)/1 var(--az-font-ui);
    letter-spacing:-.045em;
  }
  .az-arcade-session-title { min-width:0; }
  .az-arcade-session-actions {
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
  }
  .az-arcade-session-meta {
    color:#8291ac;
    font-size:11px;
    text-align:right;
    white-space:nowrap;
  }
  .az-arcade-back,
  .az-arcade-session-close {
    min-height:44px;
    border:1px solid rgba(154,174,216,.2);
    background:rgba(29,40,64,.78);
    color:#eaf1ff;
    cursor:pointer;
  }
  .az-arcade-back {
    padding:0 13px;
    border-radius:12px;
    font:700 11px var(--az-font-ui);
  }
  .az-arcade-session-close {
    width:44px;
    flex:0 0 44px;
    padding:0;
    border-radius:50%;
    font:500 22px/1 var(--az-font-ui);
  }
  .az-arcade-session-close:hover,
  .az-arcade-back:hover { border-color:rgba(127,240,200,.5);background:rgba(38,53,82,.94); }
  .az-arcade-cabinet {
    min-height:0;
    flex:1;
    display:grid;
    place-items:center;
  }
  .az-arcade-cabinet > * { max-width:100%; }
  .az-blockfall canvas { touch-action:none; }

  @media (max-width:1199px) {
    .az-window[data-app-id="camera"] .az-camera-stage { max-height:360px; }
  }
  @media (max-width:599px), (max-height:500px) and (max-width:899px) {
    .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) {
      border-radius:0;
    }
    .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-body {
      border-radius:0;
      box-shadow:none;
    }
    .az-window:is([data-app-id="calculator"],[data-app-id="winamp"],[data-app-id="games"]) .az-window-bar {
      top:7px;
      right:max(7px,env(safe-area-inset-right));
    }
    .az-window[data-app-id="camera"] .az-camera {
      width:100%;
      padding:9px;
    }
    .az-window[data-app-id="camera"] .az-camera-stage {
      max-height:min(44vh,330px);
      aspect-ratio:4/3;
    }
    .az-game-stage:not([hidden]) {
      position:fixed;
      inset:48px 0 0;
      padding:10px;
    }
    .az-arcade-session-head {
      grid-template-columns:auto minmax(0,1fr) 44px;
      gap:8px;
    }
    .az-arcade-session-actions { width:44px; }
    .az-arcade-session-meta { display:none; }
    .az-arcade-session-head h3 { font-size:22px; }
    .az-arcade-cabinet { align-items:start; }
  }


/* Calculator: compact, predictable four-column keypad. Window geometry is owned by shell.js. */
  .az-window[data-app-id="calculator"] .az-calculator-shell {
    display:grid;
    place-items:center;
    padding:18px;
  }
  .az-window[data-app-id="calculator"] .az-calc {
    width:min(100%,350px);
    max-width:none;
    margin:0;
    padding:18px;
    border:1px solid rgba(74,91,125,.12);
    border-radius:20px;
    background:rgba(255,255,255,.72);
    box-shadow:0 18px 48px rgba(48,63,92,.09);
  }
  .az-window[data-app-id="calculator"] .az-calc-meta {
    min-height:22px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin:0 2px 8px;
    color:#68758a;
    font-size:11px;
    font-weight:650;
  }
  .az-window[data-app-id="calculator"] .az-calc-meta strong {
    min-width:18px;
    color:#5265db;
    font-size:12px;
  }
  .az-window[data-app-id="calculator"] .az-calc-display {
    min-height:72px;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    padding:16px 18px;
    border:1px solid #183629;
    border-radius:13px;
    background:#0d1a14;
    color:#7ff0c8;
    font-size:30px;
  }
  .az-window[data-app-id="calculator"] .az-calc-memory,
  .az-window[data-app-id="calculator"] .az-calc-keys {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:7px;
  }
  .az-window[data-app-id="calculator"] .az-calc-memory { margin:12px 0 7px; }
  .az-window[data-app-id="calculator"] .az-calc-key {
    min-width:0;
    min-height:48px;
    border-radius:10px;
    font-size:14px;
  }
  .az-window[data-app-id="calculator"] .az-calc-key--memory {
    color:#4859bd;
    background:#eef1fb;
  }
  .az-window[data-app-id="calculator"] .az-calc-key--operator {
    color:#4053bd;
    background:#edf1ff;
  }
  .az-window[data-app-id="calculator"] .az-calc-key--eq {
    grid-column:1/-1;
    min-height:50px;
    margin-top:1px;
    border-color:#485ad0;
    background:#5265db;
    color:#fff;
  }


  /* Camera startup/privacy state. */
  .az-window[data-app-id="camera"] .az-camera-privacy {
    display:flex;
    align-items:center;
    gap:10px;
    padding:9px 12px;
    border:1px solid rgba(75,91,200,.12);
    border-radius:12px;
    background:rgba(237,241,255,.72);
    color:#59677d;
    font-size:11.5px;
    line-height:1.4;
  }
  .az-window[data-app-id="camera"] .az-camera-privacy strong {
    flex:0 0 auto;
    color:#4053bd;
  }


  /* Winamp remains intentionally player-like without another title bar. */
  .az-window[data-app-id="winamp"] .az-winamp-shell {
    display:grid;
    place-items:center;
    padding:18px;
  }
  .az-window[data-app-id="winamp"] .az-winamp {
    width:min(100%,440px);
    max-width:none;
    margin:0;
  }
  .az-window[data-app-id="winamp"] .az-winamp-brand {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    color:#8ff3cf;
    font-size:11px;
    letter-spacing:.08em;
  }
  .az-window[data-app-id="winamp"] .az-winamp-brand strong { font-size:13px;letter-spacing:.14em; }
  .az-window[data-app-id="winamp"] .az-winamp-brand span { color:#8fa2bb;letter-spacing:0; }


  /* Recycle Bin uses one clean toolbar inside the OS window. */
  .az-window[data-app-id="recycle-bin"] .az-recycle-actions > strong {
    margin-right:4px;
    color:#25334a;
    font-size:12px;
  }


  /* Analytics Sets: catalog first, collection detail second. */
  .az-window[data-app-id="analytics"] .az-analytics-app {
    min-height:100%;
    background:linear-gradient(145deg,#fbfcff 0%,#f1f5fc 100%);
  }
  .az-window[data-app-id="analytics"] .az-analytics-index {
    min-height:100%;
    padding:clamp(26px,4vw,50px);
    overflow:auto;
  }
  .az-window[data-app-id="analytics"] .az-analytics-intro {
    max-width:760px;
    margin-bottom:28px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-intro .az-kicker,
  .az-window[data-app-id="analytics"] .az-analytics-set-card .az-kicker,
  .az-window[data-app-id="analytics"] .az-analytics-section-head .az-kicker {
    margin:0 0 10px;
    color:#4b5bc8;
    font-size:11px;
    font-weight:760;
    letter-spacing:.1em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-intro h2 {
    margin:0;
    color:#172033;
    font:700 clamp(38px,5vw,64px)/.98 var(--az-font-ui);
    letter-spacing:-.05em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-intro > p:last-child {
    max-width:680px;
    margin:16px 0 0;
    color:#5d6a80;
    font-size:14px;
    line-height:1.65;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-card {
    min-height:330px;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:18px;
    padding:24px;
    border:1px solid rgba(84,100,135,.14);
    border-radius:22px;
    background:rgba(255,255,255,.76);
    box-shadow:0 16px 40px rgba(40,55,87,.06);
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-card h3 {
    margin:0;
    color:#1b2740;
    font:680 clamp(28px,3vw,42px)/1 var(--az-font-ui);
    letter-spacing:-.045em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-card h3 span { color:#5366db; }
  .az-window[data-app-id="analytics"] .az-analytics-set-card p:not(.az-kicker) {
    margin:13px 0 0;
    color:#5d6a80;
    font-size:12.5px;
    line-height:1.55;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-card > .az-button { margin-top:auto; }
  .az-window[data-app-id="analytics"] .az-analytics-set-metrics {
    width:100%;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-metrics span {
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
    padding:10px;
    border-radius:12px;
    background:#f2f5fc;
    color:#596579;
    font-size:11px;
    line-height:1.25;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-metrics strong {
    color:#33415e;
    font-size:20px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-language-badge {
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:5px 9px;
    border:1px solid rgba(82,101,219,.2);
    border-radius:999px;
    background:#eef1ff;
    color:#4859bd;
    font-size:11px;
    font-weight:740;
    letter-spacing:.01em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-set-card--future {
    background:linear-gradient(145deg,rgba(245,247,252,.88),rgba(237,241,249,.78));
    box-shadow:none;
  }
  .az-window[data-app-id="analytics"] .az-analytics-coming {
    margin-top:auto;
    padding:7px 10px;
    border:1px dashed rgba(82,101,219,.34);
    border-radius:999px;
    color:#5366db;
    font-size:11px;
    font-weight:700;
  }
  .az-window[data-app-id="analytics"] .az-analytics-detail-bar {
    position:sticky;
    top:0;
    z-index:5;
    min-height:52px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 14px;
    border-bottom:1px solid rgba(76,92,123,.11);
    background:rgba(250,252,255,.88);
    backdrop-filter:blur(18px);
  }
  .az-window[data-app-id="analytics"] .az-analytics-detail-bar span {
    color:#68758a;
    font-size:11px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-detail { overflow:auto; }
  .az-window[data-app-id="analytics"] .az-analytics-detail .az-hr-spotlight {
    min-height:520px;
    overflow:visible;
  }
  .az-window[data-app-id="analytics"] .az-analytics-detail .az-hr-status {
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-content:center;
  }
  .az-window[data-app-id="analytics"] .az-analytics-detail .az-hr-status article { min-height:94px; }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-section {
    padding:clamp(28px,4vw,48px);
    border-top:1px solid rgba(76,92,123,.1);
    background:#f6f8fc;
  }
  .az-window[data-app-id="analytics"] .az-analytics-section-head { max-width:720px;margin-bottom:22px; }
  .az-window[data-app-id="analytics"] .az-analytics-section-head h2 {
    margin:0;
    color:#1b2740;
    font:680 clamp(28px,3.4vw,42px)/1.05 var(--az-font-ui);
    letter-spacing:-.04em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-section-head > p:last-child {
    margin:12px 0 0;
    color:#647187;
    font-size:13px;
    line-height:1.6;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-card {
    min-height:190px;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    padding:18px;
    border:1px solid rgba(80,97,130,.13);
    border-radius:16px;
    background:rgba(255,255,255,.86);
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-number {
    margin-bottom:13px;
    color:#5265db;
    font:750 11px/1 var(--az-font-mono);
    letter-spacing:.08em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-card h3 {
    margin:0;
    color:#25324a;
    font-size:17px;
    letter-spacing:-.025em;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-card .az-analytics-language-badge {
    margin-top:9px;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-card p {
    margin:8px 0 14px;
    color:#68758a;
    font-size:11.5px;
    line-height:1.55;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-card a {
    margin-top:auto;
    color:#4658c5;
    font-size:11.5px;
    font-weight:720;
    text-decoration:none;
  }
  .az-window[data-app-id="analytics"] .az-analytics-dashboard-card a:hover { text-decoration:underline;text-underline-offset:3px; }

  @media (max-width:760px) {
    .az-window[data-app-id="analytics"] .az-analytics-set-grid,
    .az-window[data-app-id="analytics"] .az-analytics-dashboard-grid { grid-template-columns:1fr; }
    .az-window[data-app-id="analytics"] .az-analytics-detail .az-hr-status { grid-template-columns:1fr 1fr; }
    .az-window[data-app-id="analytics"] .az-analytics-detail .az-hr-spotlight { grid-template-columns:1fr;min-height:0; }
  }
}
