/* ==========================================================================
   KUTAY OS — Shell
   Generic desktop chrome shared by every page: menu bar, dock, window
   chrome, dialogs, context menu, spotlight, calendar/weather/control-center
   panels, and the split-view "Finder" layout used by Work/Files/etc.
   Home's own composition (the "6 realms") lives in home.css, not here.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Wallpaper (app pages) — soft parallax landscape behind the app window   */
/* ---------------------------------------------------------------------- */
.wallpaper {
  position: fixed; inset: 0; overflow: hidden; z-index: 0;
  background:
    radial-gradient(ellipse at 75% 12%, #31475a, transparent 63%),
    linear-gradient(150deg, #10171e, #080c12 80%);
  isolation: isolate;
}
.wallpaper:before {
  content: ""; position: absolute; inset: 0; opacity: .36;
  background: radial-gradient(ellipse at 92% 66%, #76604d, transparent 50%);
}
.wallpaper:after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #05081055, transparent 70%), linear-gradient(0deg, #05080e88, transparent 60%);
}
.landscape-plane {
  position: absolute; left: -12%; right: -12%; border-radius: 50% 50% 0 0;
  transition: transform 1s var(--ease-out);
  box-shadow: 0 -1px 0 rgba(202, 210, 214, .09), 0 -55px 100px rgba(5, 9, 14, .21);
  pointer-events: none;
}
.plane-far { height: 90%; top: 49%; background: linear-gradient(174deg, #53627033, #10171e 36%, #070a0e); border-radius: 58% 90% 0 0; }
.plane-near { height: 80%; top: 72%; left: -20%; right: -20%; background: linear-gradient(163deg, #76604d, #14181d 14%, #080c11 55%); border-radius: 95% 70% 0 0; opacity: .7; }
.landscape-grain {
  position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.23' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}
body[data-atmosphere="graphite"] .wallpaper { background: radial-gradient(ellipse at 75% 12%, #3b3e43, transparent 63%), linear-gradient(150deg, #191715, #080c12 80%); }
body[data-atmosphere="graphite"] .plane-far { background: linear-gradient(174deg, #3b3e4333, #191715 36%, #070a0e); }
body[data-atmosphere="graphite"] .plane-near { background: linear-gradient(163deg, #886346, #14181d 14%, #080c11 55%); }
body[data-atmosphere="midnight"] .wallpaper { background: radial-gradient(ellipse at 75% 12%, #233e60, transparent 63%), linear-gradient(150deg, #0a111d, #080c12 80%); }
body[data-atmosphere="midnight"] .plane-far { background: linear-gradient(174deg, #233e6033, #0a111d 36%, #070a0e); }
body[data-atmosphere="midnight"] .plane-near { background: linear-gradient(163deg, #384c68, #14181d 14%, #080c11 55%); }
.static-wallpaper .landscape-plane, .reduce-motion .landscape-plane { transform: none !important; transition: none; }

/* ---------------------------------------------------------------------- */
/* Menu bar                                                                 */
/* ---------------------------------------------------------------------- */
.menu {
  position: fixed; z-index: var(--z-menu); inset: 0 0 auto 0; height: var(--menu-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--menu-bg); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--line); color: var(--text);
}
.menu-brand { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px 0 4px; margin-right: 2px; border-radius: 10px; flex-shrink: 0; white-space: nowrap; transition: background var(--dur-fast); }
.menu-brand:hover { background: var(--hover); }
.menu-brand img { width: 26px; height: 26px; object-fit: contain; border-radius: 50%; }
.menu-brand strong { font-size: 13px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.menu-nav { display: flex; gap: 2px; font-size: 12.5px; }
.menu-nav a { display: flex; align-items: center; height: 34px; padding: 0 11px; border-radius: 8px; color: var(--text-muted); transition: background var(--dur-fast), color var(--dur-fast); }
.menu-nav a:hover, .menu-nav a[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.menu-nav a.active { color: var(--text); }
.menu-spacer { flex: 1; min-width: 8px; }
.mobile-menu { display: none; }
.menu-search { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.menu-search:hover { background: var(--hover); }
.menu-cta { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; margin-left: 6px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 650; white-space: nowrap; flex-shrink: 0; transition: transform var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-base); }
.menu-cta:hover { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-1px); }
.menu-cta:active { transform: translateY(0) scale(.97); }
.menu-cta span { transition: transform var(--dur-base) var(--ease-out); }
.menu-cta:hover span { transform: translateX(3px); }

/* Spaces: the six desktops, switched from the menu bar (home only) */
.spaces { position: relative; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--hover); border: 1px solid var(--line-2); min-width: 0; }
.spaces-pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-pill); background: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); transition: transform .42s cubic-bezier(.2, .9, .25, 1.15), width .42s cubic-bezier(.2, .9, .25, 1.15); pointer-events: none; }
.space { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: var(--r-pill); background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 550; white-space: nowrap; transition: color .25s; }
.space i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex-shrink: 0; transition: transform .25s var(--ease-out), box-shadow .25s; }
.space:hover { color: var(--text); }
.space:hover i { transform: scale(1.35); }
.space[aria-current="page"] { color: var(--bg); }
.space[aria-current="page"] i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.spaces-all { position: relative; z-index: 1; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: transparent; color: var(--text-muted); }
.spaces-all:hover { color: var(--text); background: var(--hover); }
.spaces-all svg { width: 15px; height: 15px; }
.spaces-compact { display: none; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--r-pill); background: var(--hover); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.spaces-compact i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.spaces-compact b { font-weight: 400; color: var(--text-muted); font-size: 11px; }

.menu-status { display: flex; align-items: center; gap: 2px; font-size: 12px; flex-shrink: 0; min-width: 0; }
.status-button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 36px; height: 40px; padding: 0 8px; border-radius: 7px;
  background: transparent; color: var(--text-muted); white-space: nowrap; line-height: 1.2;
}
.status-button:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.status-weather { max-width: 215px; }
.status-weather span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.status-calendar { gap: 10px; padding: 0 11px; font-variant-numeric: tabular-nums; }
.status-focus.running { color: var(--accent); }
.status-focus [data-focus-count] { font-size: 11px; font-variant-numeric: tabular-nums; }
.status-spaces { gap: 5px; }
.status-spaces [data-window-count] { font-size: 10px; min-width: 13px; color: var(--text-dim); }
.status-spaces.has-windows [data-window-count] { color: var(--accent); }
.language-button { padding: 0 10px; margin-left: 3px; border-left: 1px solid var(--line); border-radius: 0; min-width: 62px; font-size: 11px; }
.control-center { margin-left: 3px; }

.status-battery { gap: 9px; min-width: 78px; color: var(--text); }
.battery-shell { position: relative; display: block; width: 25px; height: 13px; padding: 2px; border: 1px solid currentColor; border-radius: 3px; flex-shrink: 0; box-sizing: border-box; }
.battery-shell:after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 5px; border-radius: 0 1px 1px 0; background: currentColor; opacity: .7; }
.battery-level { height: 100%; display: block; max-width: 100%; border-radius: 1px; background: currentColor; transition: width var(--dur-base); }
.status-battery [data-battery-value] { display: block; min-width: 30px; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.status-battery.low { color: var(--red); }
.status-battery.charging { color: var(--green); }

/* ---------------------------------------------------------------------- */
/* Dock                                                                     */
/* Pantone swatch chips (js/shell/app-icons.js) on a glass shelf, each    */
/* with its name underneath; dots mark the current page (ink) and open    */
/* windows (accent). Magnification widens the item itself, so neighbours  */
/* make room instead of being covered.                                     */
/* ---------------------------------------------------------------------- */
.dock {
  --icon: calc(46px * var(--dock-scale, 1)); --tip-bg: rgba(22, 24, 22, .94);
  position: fixed; z-index: var(--z-dock); left: 50%; bottom: 10px; transform: translateX(-50%);
  height: var(--dock-h); max-width: calc(100vw - 16px);
  display: flex; align-items: flex-end; gap: 2px; padding: 0 10px;
  border-radius: 22px; isolation: isolate;
}
/* the dock's glass is its own layer, so it can widen with the magnified chips without laying the dock out again */
.dock::before { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none; transform: scaleX(var(--gs, 1));
  background: var(--dock-bg); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0, 0, 0, .16), inset 0 1px rgba(255, 255, 255, .07); }
.dock a { --mag: 1; position: relative; flex: 0 0 auto; height: 100%; min-width: calc(var(--icon) + 10px); padding: 0 4px 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; border-radius: 14px; color: var(--text-muted); translate: var(--dx, 0px) 0; }
.dock a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dock-art {
  position: relative; flex: none; width: var(--icon); height: var(--icon);
  transform: translate(var(--mx, 0px), calc(var(--my, 0px) + (var(--mag) - 1) * -14px)) rotate(var(--rot, 0deg)) scale(var(--mag)); transform-origin: 50% 100%;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.2); filter: drop-shadow(0 1px 1.2px rgba(0, 0, 0, .18));
}
.dock.is-live .dock-art { transition: none; }
.dock-sep { translate: var(--dx, 0px) 0; }
.dock-art .app-icon, .desk-art .app-icon, .launcher-drag-ghost .app-icon { display: block; width: 100%; height: 100%; }
.dock a:active .dock-art { filter: brightness(.9) drop-shadow(0 1px 1.2px rgba(0, 0, 0, .18)); }
.dock a.launch .dock-art { animation: dockLaunch .7s cubic-bezier(.3, .7, .4, 1); }
@keyframes dockLaunch { 0%, 100% { translate: 0 0; } 35% { translate: 0 -14px; } 60% { translate: 0 0; } 80% { translate: 0 -5px; } }
.dock .tip { position: relative; z-index: 1; font: 550 calc(8px + 2px * var(--dock-scale, 1))/1.2 var(--font-sans); letter-spacing: .01em; white-space: nowrap; color: inherit; pointer-events: none; transition: color var(--dur-fast); }
.dock a:hover, .dock a.active, .dock a:focus-visible { color: var(--text); }
.dock a.active .tip { font-weight: 700; }
.dock a::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); opacity: 0; transform: scale(0); transition: opacity .2s, transform .3s cubic-bezier(.2, .9, .3, 1.4); }
.dock a.running::after, .dock a.active::after { opacity: 1; transform: scale(1); }
.dock a.active::after { background: var(--text); }
.dock .is-hidden-app { display: none; }
.dock-badge { position: absolute; z-index: 1; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 10px/1 var(--font-sans); box-shadow: 0 0 0 2px var(--dock-bg); }
.dock-sep { position: relative; flex: none; width: 1px; height: calc(44px * var(--dock-scale, 1)); align-self: center; margin: 0 5px; background: var(--line); cursor: ns-resize; }
.dock-sep::before { content: ""; position: absolute; inset: -10px -8px; }
.dock.is-resizing, .dock.is-resizing * { cursor: ns-resize !important; }
@media (min-width: 601px) and (max-width: 1099px) {
  .dock { --icon: clamp(34px, calc((100vw - 200px) / 14), 44px); padding-inline: 6px; }
  .dock a { min-width: 0; flex: 0 1 auto; padding-inline: 2px; }
  .dock .tip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; }
  .dock-sep { margin-inline: 2px; }
}
@media (min-width: 601px) and (max-width: 780px) {
  .dock a { justify-content: center; padding-bottom: 0; }
  .dock .tip { display: none; }
}

.task-tray {
  position: fixed; z-index: var(--z-task-tray); bottom: 18px; right: 16px;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: calc(50vw - 270px);
}
.task-btn {
  background: rgba(39, 44, 54, .91); backdrop-filter: blur(16px); border: 1px solid var(--line);
  min-height: 40px; padding: 8px 12px; font-size: 12px; border-radius: 10px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-btn:hover { background: rgba(58, 65, 79, .95); }

/* ---------------------------------------------------------------------- */
/* Desktop surface + icon grid (used inside realm rooms and by legacy apps) */
/* ---------------------------------------------------------------------- */
.app-desktop, .desktop { position: fixed; inset: var(--menu-h) 0 0; overflow: hidden; z-index: var(--z-desktop); }
.app-desktop { bottom: 0; }

.desktop-icons { position: absolute; inset: 0; z-index: var(--z-icons); pointer-events: none; }
.desk-icon {
  position: absolute; width: 88px; min-height: 94px; padding: 10px 5px 8px;
  border: 1px solid transparent; border-radius: 12px; pointer-events: auto; user-select: none; touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
}
.desk-label { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; width: 100%; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); color: var(--text); text-align: center; }
.desk-icon:hover { background: rgba(255, 255, 255, .07); }
.desk-icon.is-selected { outline: 2px solid rgba(255, 138, 61, .6); outline-offset: -2px; background: rgba(255, 138, 61, .08) !important; }
.desk-icon.is-dragging { z-index: 7000; background: rgba(255, 255, 255, .13); box-shadow: var(--shadow-md); cursor: grabbing; transition: none; }
.drop-target { outline: 2px solid var(--accent); background: rgba(255, 138, 61, .15) !important; }
.folder { width: 48px; height: 36px; margin: 0 auto 8px; border-radius: 7px; position: relative; background: linear-gradient(#6f7a87, #49515e); box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 8px 16px rgba(0, 0, 0, .22); }
.folder:before { content: ""; position: absolute; left: 4px; top: -5px; width: 22px; height: 7px; border-radius: 5px 5px 0 0; background: inherit; }
.folder.orange { background: linear-gradient(#ffa45e, #d76d24); }
.folder.blue { background: linear-gradient(#72c2ff, #2d82c7); }
.paper { width: 35px; height: 44px; margin: 0 auto 8px; border-radius: 6px; background: linear-gradient(135deg, #f0f1f2, #aeb4bc); position: relative; }
.paper:after { content: ""; position: absolute; left: 7px; right: 7px; top: 12px; height: 2px; background: #737780; box-shadow: 0 7px #737780, 0 14px #737780; }
.drive { width: 45px; height: 28px; border-radius: 8px; margin: 0 auto 9px; background: linear-gradient(#c6ccd3, #767f89); box-shadow: inset 0 2px rgba(255, 255, 255, .6), 0 8px 16px rgba(0, 0, 0, .25); }
body[data-icon-size="large"] .desk-icon { width: 104px; min-height: 110px; }
body[data-icon-size="large"] .folder { transform: scale(1.14); margin-bottom: 15px; }
body[data-icon-size="large"] .desk-label { font-size: 14px; }

/* ---------------------------------------------------------------------- */
/* Window chrome                                                           */
/* ---------------------------------------------------------------------- */
.window, .app-window {
  position: absolute; border-radius: var(--r-xl);
  background: var(--window-bg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(28px) saturate(145%);
  overflow: hidden; z-index: var(--z-window);
  transition: box-shadow var(--dur-base), border-color var(--dur-base);
  min-width: 0; min-height: 0;
}
.window::after, .app-window::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 1px rgba(255, 255, 255, .08); }
.window.is-active, .app-window.is-active { border-color: var(--line-strong); box-shadow: var(--shadow-xl); z-index: var(--z-window-active); }

.app-window { left: 50%; top: 16px; transform: translateX(-50%); width: min(1280px, calc(100vw - 48px)); height: min(900px, calc(100dvh - var(--menu-h) - var(--dock-reserve) - 16px)); }
.app-window .body { height: calc(100% - var(--titlebar-h)); overflow: auto; min-height: 0; }

.titlebar {
  height: var(--titlebar-h); min-height: var(--titlebar-h); border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; padding: 0 10px; gap: 10px;
  user-select: none; cursor: grab; touch-action: none;
}
.titlebar .title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; line-height: 1.4; }
.is-moving, .is-moving .titlebar { cursor: grabbing; transition: none !important; }

.ps-controls { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ps-btn { width: 32px; height: 36px; padding: 5px; display: grid; place-items: center; background: transparent; border-radius: 7px; transition: background var(--dur-fast), transform var(--dur-fast); }
.ps-btn:hover { transform: scale(1.08); }
.ps-btn svg { width: 19px; height: 19px; stroke-width: 2; }
.ps-circle { color: var(--ps-circle); } .ps-circle:hover { background: rgba(247, 162, 162, .13); }
.ps-square { color: var(--ps-square); } .ps-square:hover { background: rgba(244, 162, 215, .13); }
.ps-cross { color: var(--ps-cross); }
.ps-triangle { color: #ffd98a; } .ps-triangle:hover { background: rgba(255, 217, 138, .13); } .ps-cross:hover { background: rgba(148, 197, 255, .13); }

.bar-actions { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }
.bar-btn { width: 34px; height: 34px; min-width: 34px; border-radius: 8px; background: var(--hover); color: var(--text); display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.bar-btn:hover { background: var(--hover-strong); }

.window.is-maximized, .app-window.is-maximized {
  position: absolute !important; inset: 8px !important; width: calc(100% - 16px) !important; height: calc(100% - 16px) !important;
  transform: none !important; margin: 0 !important; border-radius: var(--r-lg); max-height: none;
}

.window-enter { animation: windowIn var(--dur-base) var(--ease-out); }
.window-exit { animation: windowOut var(--dur-fast) ease-in forwards; pointer-events: none; }
@keyframes windowIn { from { opacity: .1; translate: 0 12px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes windowOut { to { opacity: 0; translate: 0 18px; scale: .93; } }

.pointer-busy { user-select: none; cursor: grabbing; }
.pointer-busy iframe { pointer-events: none; }

.os-frame { display: block; border: 0; width: 100%; height: calc(100% - var(--titlebar-h)); background: #10131a; }
.closed-app { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; align-content: center; gap: 12px; }
.closed-app b { font-size: 22px; flex-basis: 100%; text-align: center; margin-bottom: 10px; }

/* Resize handles + snap preview */
.resize-handle { position: absolute; z-index: 9; touch-action: none; }
.resize-n, .resize-s { height: 7px; left: 14px; right: 14px; cursor: ns-resize; }
.resize-n { top: 0; } .resize-s { bottom: 0; }
.resize-e, .resize-w { width: 7px; top: 14px; bottom: 14px; cursor: ew-resize; }
.resize-e { right: 0; } .resize-w { left: 0; }
.resize-ne, .resize-nw, .resize-se, .resize-sw { width: 15px; height: 15px; }
.resize-ne { right: 0; top: 0; cursor: nesw-resize; }
.resize-nw { left: 0; top: 0; cursor: nwse-resize; }
.resize-se { right: 0; bottom: 0; cursor: nwse-resize; background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255, 255, 255, .14) 3px 4px); clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.resize-sw { left: 0; bottom: 0; cursor: nesw-resize; }
.is-maximized .resize-handle { display: none; }

.snap-preview {
  position: absolute; border: 1px solid rgba(255, 195, 151, .55); border-radius: var(--r-xl);
  background: linear-gradient(145deg, rgba(255, 155, 91, .14), rgba(156, 186, 238, .09));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 10px 45px rgba(0, 0, 0, .12);
  pointer-events: none; z-index: 8000; display: grid; place-items: center;
  transition: width .13s, height .13s, left .13s, top .13s;
}
.snap-preview > span { padding: 10px 16px; background: rgba(21, 23, 29, .87); color: #f9e1d2; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow-sm); }

.layout-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.layout-option { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 8px; display: grid; gap: 8px; text-align: center; font-size: 12px; }
.layout-option:hover { background: rgba(255, 155, 91, .1); border-color: rgba(255, 155, 91, .4); }
.layout-diagram { width: 64px; height: 44px; border: 1px solid #6f7889; border-radius: 5px; position: relative; margin: auto; }
.layout-diagram i { position: absolute; inset: 3px; border-radius: 2px; background: rgba(255, 155, 91, .47); }
.layout-diagram.left i { right: 50%; } .layout-diagram.right i { left: 50%; }
.layout-diagram.top i { bottom: 50%; } .layout-diagram.bottom i { top: 50%; }
.layout-diagram.top-left i { right: 50%; bottom: 50%; } .layout-diagram.top-right i { left: 50%; bottom: 50%; }
.layout-diagram.bottom-left i { right: 50%; top: 50%; } .layout-diagram.bottom-right i { left: 50%; top: 50%; }

/* ---------------------------------------------------------------------- */
/* Dialogs, context menu, toast                                            */
/* ---------------------------------------------------------------------- */
.os-dialog {
  width: min(490px, calc(100vw - 28px)); max-height: 85dvh; overflow: auto;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 0; box-shadow: var(--shadow-xl); z-index: var(--z-dialog);
}
.os-dialog::backdrop { background: rgba(2, 5, 10, .61); backdrop-filter: blur(7px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.dialog-head h2 { font-size: 18px; line-height: 1.3; }
.dialog-content { padding: 18px; line-height: 1.6; }
.dialog-content p { font-size: 14px; }
.dialog-content input, .dialog-content select { display: block; width: 100%; height: 44px; padding: 8px 10px; margin-top: 7px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 8px; font-size: 16px; }
.dialog-actions { padding: 0 18px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.info-list { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.info-list dt { color: var(--text-muted); }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
.shortcut-list p { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; font-size: 13px !important; }
.shortcut-list span { color: var(--text-muted); }
.muted { color: var(--text-muted); }

.workspace-intro { padding: 2px 4px 14px; }
.workspace-intro .eyebrow { font-size: 10px; color: var(--accent); letter-spacing: .12em; }
.workspace-intro h3 { font-size: 26px; font-weight: 500; line-height: 1.1; margin: 14px 0 8px; letter-spacing: -.03em; }
.workspace-intro p, .workspace-footnote { font-size: 13px; color: var(--text-muted); }
.workspace-options { display: grid; gap: 8px; }
.workspace-options > button { display: flex; align-items: center; gap: 18px; text-align: left; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; }
.workspace-options > button:hover { background: rgba(217, 156, 96, .07); border-color: rgba(230, 181, 140, .35); }
.workspace-number { font-size: 11px; color: var(--accent); align-self: flex-start; padding-top: 3px; }
.workspace-options b { font-size: 15px; font-weight: 500; }
.workspace-options p { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 6px 0 0; }
.workspace-options > button > span:last-child { margin-left: auto; font-size: 18px; color: var(--text-muted); }
.workspace-footnote { margin: 16px 4px 0; font-size: 11px; }

.context-menu {
  position: fixed; z-index: var(--z-context-menu); min-width: 225px; max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px); overflow: auto; padding: 6px;
  background: color-mix(in srgb, var(--panel, #242730) 97%, transparent); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  border-radius: var(--r-md); backdrop-filter: blur(24px);
}
.context-menu button { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 36px; padding: 8px 10px; border-radius: 6px; font-size: 13px; background: transparent; }
.context-menu button { color: inherit; }
.context-menu button:disabled { opacity: .42; }
.context-menu button:not(:disabled):hover, .context-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.context-menu small { font-size: 12px; color: var(--text-muted); }
.context-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-reserve) + 10px); transform: translateX(-50%) translateY(10px); z-index: var(--z-toast);
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow-md); font-weight: 550;
  backdrop-filter: blur(20px); font-size: 12px; max-width: calc(100vw - 24px); width: max-content; text-align: center;
  line-height: 1.4; opacity: 0; pointer-events: none; transition: var(--dur-base);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------------- */
/* Spotlight search                                                         */
/* ---------------------------------------------------------------------- */
.spotlight-dialog { width: 600px; max-width: min(600px, calc(100vw - 24px)); }
.spotlight-input { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.spotlight-input svg { color: var(--text-muted); }
.spotlight-input input { background: transparent !important; border: 0 !important; height: 54px; font-size: 16px !important; min-width: 0; width: 100%; margin: 0 !important; }
.spotlight-results { max-height: 400px; overflow: auto; margin-top: 12px; }
.spotlight-results button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 15px; text-align: left; padding: 12px 14px; background: transparent; border-radius: 8px; font-size: 14px; }
.spotlight-results button.on, .spotlight-results button:hover { background: rgba(255, 172, 115, .08); }
.spotlight-results button.on { outline: 1px solid rgba(245, 184, 137, .2); outline-offset: -1px; }
.spotlight-results small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 5px; }
.spotlight-results button > span:last-child { color: var(--accent); }
.spotlight-hint { font-size: 11px; color: var(--text-dim); margin: 16px 0 0; }

/* ---------------------------------------------------------------------- */
/* Calendar / focus / control-center / weather panels                      */
/* ---------------------------------------------------------------------- */
.control-summary { display: grid; gap: 8px; margin-bottom: 18px; }
.control-summary p { display: flex; align-items: center; gap: 12px; font-size: 13px; margin: 0; line-height: 1.6; }
.control-summary svg { color: var(--text-muted); flex-shrink: 0; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.control-grid .btn { min-height: 48px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); justify-content: flex-start; padding: 12px 16px; text-align: left; }
.control-language { border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; font-size: 13px; }
.control-language .btn { background: rgba(255, 255, 255, .05); }

.calendar-content { max-width: 380px; margin: auto; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; gap: 8px; }
.calendar-heading b { font-size: 17px; font-weight: 500; text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.calendar-grid > span { min-height: 38px; display: grid; place-items: center; font-size: 13px; }
.calendar-grid .weekday { color: var(--text-muted); font-size: 11px; min-height: 26px; }
.calendar-day.today { background: var(--accent); color: var(--accent-ink); border-radius: 9px; font-weight: 700; }
.calendar-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.calendar-footer > span { font-size: 11px; color: var(--text-muted); }
.calendar-footer .btn { background: rgba(255, 255, 255, .05); }

.focus-panel { text-align: center; padding: 8px 20px 10px; }
.focus-panel > svg { width: 30px; height: 30px; color: var(--accent); }
.focus-time { font-variant-numeric: tabular-nums; font-size: 72px; letter-spacing: -.04em; margin: 18px 0 10px; }
.focus-panel p { font-size: 14px; color: var(--text-muted); }
.focus-panel .muted { font-size: 11px; margin-top: 22px; }
.focus-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.focus-actions .btn { min-width: 96px; }

.battery-detail { text-align: center; padding: 20px 12px; }
.battery-detail strong { font-size: 54px; font-weight: 400; letter-spacing: -.03em; }
.battery-detail p { color: var(--text); }
.battery-detail small { display: block; line-height: 1.7; color: var(--text-muted); }

.window-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switcher-item { display: flex; align-items: center; gap: 12px; padding: 16px 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 12px; text-align: left; min-width: 0; }
.switcher-item:hover { border-color: rgba(214, 183, 153, .4); background: rgba(214, 183, 153, .04); }
.switcher-item b { font-size: 13px; font-weight: 500; display: block; overflow-wrap: anywhere; }
.switcher-item small { font-size: 10px; display: block; color: var(--text-muted); margin-top: 6px; }
.switcher-item > span:last-child { margin-left: auto; color: var(--accent); }
.switcher-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.atmosphere-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.atmosphere-option { padding: 7px 7px 13px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; line-height: 1.4; }
.atmosphere-option[aria-pressed="true"] { border-color: #c9a989; }
.atmosphere-swatch { display: block; height: 80px; border-radius: 6px; margin-bottom: 10px; background: linear-gradient(160deg, #374f63, #111821 55%, #77604b); }
.atmosphere-swatch.graphite { background: linear-gradient(160deg, #454445, #1c1916 55%, #906342); }
.atmosphere-swatch.midnight { background: linear-gradient(160deg, #2d4567, #0b1422 55%, #344a62); }

.weather-current { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0 15px; }
.weather-current .eyebrow { color: var(--accent); font-size: 10px; letter-spacing: .12em; }
.weather-current h3 { font-size: 24px; font-weight: 500; letter-spacing: -.02em; margin: 8px 0; }
.weather-current p { color: var(--text-muted); font-size: 14px; margin: 0 0 8px; }
.weather-current small { color: var(--text-dim); font-size: 11px; }
.weather-current > strong { font-size: 58px; font-weight: 400; letter-spacing: -.05em; color: #f1d5bd; }
.weather-forecast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.weather-forecast > div { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; background: rgba(255, 255, 255, .02); }
.weather-forecast b { font-size: 13px; font-weight: 500; }
.weather-forecast span { font-size: 11px; color: var(--text-muted); min-height: 27px; }
.weather-forecast small { font-size: 12px; font-variant-numeric: tabular-nums; }
.weather-updated, .weather-credit { font-size: 10px; color: var(--text-dim); }
.weather-credit a { text-decoration: underline; text-underline-offset: 3px; }
.weather-empty { text-align: center; padding: 15px 15px 20px; }
.weather-empty > svg { width: 34px; height: 34px; color: #cca17e; }
.weather-empty h3 { font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.weather-empty p { font-size: 13px; color: var(--text-muted); }
.weather-location-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.weather-location-actions .btn { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); }
.city-search { margin-top: 20px; }
.city-search label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.city-search > div { display: flex; gap: 8px; }
.city-search input { margin: 0; min-width: 0; flex: 1; font-size: 16px; }
.city-search .btn { background: rgba(255, 255, 255, .06); min-width: 72px; }
.city-results { font-size: 12px; margin-top: 10px; }
.city-result { display: block; width: 100%; text-align: left; border-bottom: 1px solid var(--line-2); padding: 12px 8px; background: transparent; font-size: 14px; }
.city-result:hover { background: rgba(255, 255, 255, .05); }
.city-result small { display: block; margin-top: 5px; color: var(--text-dim); font-size: 11px; }
.weather-privacy { font-size: 11px; color: var(--text-dim); margin-top: 20px; }

/* ---------------------------------------------------------------------- */
/* Generic buttons                                                          */
/* ---------------------------------------------------------------------- */
.btn, .link-btn {
  font-size: 13px; line-height: 1.35; min-height: 36px; padding: 9px 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 9px; background: rgba(255, 255, 255, .055); border: 1px solid var(--line);
  color: var(--text);
}
.btn:hover, .link-btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.link-btn { padding: 7px 10px; font-size: 11px; }

/* ---------------------------------------------------------------------- */
/* Split-view "Finder" layout — Work / Files / Notes / Project side panels */
/* ---------------------------------------------------------------------- */
.finder, .work-page, .files-page, .notes-page, .project-page {
  display: grid; height: calc(100% - var(--titlebar-h)); min-height: 0;
}
.finder { grid-template-columns: 180px minmax(0, 1fr); }
.work-page, .files-page { grid-template-columns: 190px minmax(0, 1fr); }
.notes-page { grid-template-columns: 220px minmax(0, 1fr); }
.project-page { grid-template-columns: 200px minmax(0, 1fr); }

.sidebar { padding: 10px 8px; overflow: auto; border-right: 1px solid var(--line-2); }
.side-head { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin: 14px 8px 7px; }
.side-link { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px; border-radius: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.25; }
.side-link:hover, .side-link.active { background: rgba(255, 255, 255, .07); color: var(--text); }
.side-link small { margin-left: auto; font-size: 11px; }
.side-symbol { flex-shrink: 0; width: 15px; text-align: center; }
.finder-main { min-height: 0; display: flex; flex-direction: column; min-width: 0; }

.toolbar, .page-toolbar { height: auto; min-height: 52px; flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.page-title { font-size: 12px; font-weight: 600; }
.crumbs { font-size: 11px; color: var(--text-muted); margin-right: auto; }
.crumb-button { flex: 1; min-width: 70px; text-align: left; background: transparent; color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; padding: 5px; }
.view-toggle { display: flex; background: rgba(255, 255, 255, .05); border-radius: 8px; padding: 2px; flex-shrink: 0; gap: 1px; }
.view-toggle button { width: 34px; height: 34px; display: grid; place-items: center; background: transparent; border-radius: 6px; color: var(--text-muted); }
.view-toggle button.on { background: rgba(255, 255, 255, .1); color: var(--text); }
.view-toggle button:hover { background: rgba(255, 255, 255, .06); }
.view-toggle svg { width: 18px; height: 18px; }
.search { width: auto; min-width: 0; flex: 1; height: 36px; font-size: 13px; margin: 0; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .055); color: var(--text); }
.search:focus { outline: none; border-color: rgba(255, 138, 61, .46); box-shadow: 0 0 0 3px rgba(255, 138, 61, .08); }
.sort-select { width: 102px; flex-shrink: 0; height: 36px; padding: 5px; font-size: 12px; }
.filter-strip { display: flex; gap: 5px; padding: 0 10px 8px; overflow-x: auto; flex-shrink: 0; }
.filter-chip { font-size: 12px; padding: 7px 10px; min-height: 30px; background: transparent; color: var(--text-muted); border: 1px solid var(--line-2); border-radius: 7px; white-space: nowrap; }
.filter-chip.on { background: rgba(255, 138, 61, .13); border-color: rgba(255, 138, 61, .3); color: #ffb47d; }
.explorer-status { flex-shrink: 0; border-top: 1px solid var(--line-2); padding: 7px 12px; color: var(--text-muted); font-size: 11px; background: rgba(9, 12, 16, .2); line-height: 1.5; }
.empty-state { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--text-muted); line-height: 1.6; }
.empty-state b { color: var(--text); }
.empty-state p { font-size: 14px; }

/* ---------------------------------------------------------------------- */
/* Embedded apps (inside an iframe window on the home desktop)             */
/* ---------------------------------------------------------------------- */
html.embedded, body.embedded { height: 100%; min-height: 0; background: #11151c; overflow: hidden; }
.embedded > .wallpaper, .embedded > .menu, .embedded > .dock, .embedded > #taskTray { display: none !important; }
.embedded .app-desktop { position: fixed; inset: 0; padding: 0; min-height: 0; overflow: hidden; }
.embedded .app-window { position: absolute !important; inset: 0 !important; transform: none !important; width: 100% !important; height: 100% !important; max-height: none; margin: 0 !important; border: 0; border-radius: 0; box-shadow: none; background: #14181f; }
.embedded .app-window > .titlebar { display: none; }
.embedded .app-window > .body { height: 100%; overflow: auto; }
.embedded .closed-app { display: none; }
.embedded .toast { bottom: 16px; }

/* ---------------------------------------------------------------------- */
/* Responsive: menu/dock/window chrome                                     */
/* ---------------------------------------------------------------------- */
@media (min-width: 1100px) and (min-height: 640px) {
  .finder-window .filter-strip { display: none; }
}

@media (max-width: 1399px) {
  .menu-nav { display: none; }
  .mobile-menu { display: grid !important; min-width: 36px; width: 36px; order: 0; margin-right: 3px; }
  .menu-brand { order: -1; }
  .menu-spacer { order: 1; }
  .menu-status { order: 2; }
}

@media (max-width: 1099px), (max-height: 639px) {
  .app-desktop, .desktop {
    position: relative; inset: auto; min-height: 100dvh;
    padding: calc(var(--menu-h) + 12px) 12px 100px; overflow: visible;
  }
  .app-window {
    position: relative; inset: auto; transform: none; width: 100%;
    height: calc(100dvh - var(--menu-h) - 124px); min-height: 440px; margin: 0; max-height: none;
  }
  .resize-handle { display: none; }
  .app-window.is-maximized { position: fixed !important; inset: var(--menu-h) 0 var(--dock-reserve) !important; width: auto !important; height: auto !important; border-radius: 0; }
  .titlebar { touch-action: pan-y; cursor: default; }
  .task-tray { right: 12px; left: 12px; bottom: 84px; max-width: none; justify-content: center; flex-wrap: nowrap; overflow: auto; }
  .task-btn { flex-shrink: 0; max-width: 125px; min-height: 36px; }
  .menu-nav button { padding: 0 8px; }
}

@media (max-width: 1099px) { .menu-cta { display: none; } }

@media (max-width: 950px) {
  .status-weather, .status-network { display: none !important; }
  .status-calendar [data-date] { display: none; }
}

@media (max-width: 900px) {
  .work-page, .files-page { grid-template-columns: 1fr; }
  .work-page > .sidebar, .files-page > .sidebar { display: none; }
  .project-page { grid-template-columns: 1fr; }
  .project-page > .sidebar, .project-side { display: none; }
  .notes-page { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .menu { padding: 0 10px; gap: 5px; }
  .menu-brand strong { display: none; }
}

@media (max-width: 600px) {
  .menu-status [data-date] { display: none; }
  .menu-search { width: 36px; }
  .status-button { min-width: 34px; height: 44px; padding: 0 6px; }
  .status-focus { display: none; }
  .status-battery { min-width: 65px; gap: 7px; }
  .status-battery [data-battery-value] { font-size: 10px; min-width: 27px; }
  .battery-shell { width: 23px; height: 12px; }
  .language-button { font-size: 11px; min-width: 55px; padding: 0 6px; }
  .status-spaces { display: none; }
  .control-center { margin-left: 0; }

  /* Phone: the six apps people actually use on a phone, full width. */
  .dock { --icon: min(44px, calc((100vw - 72px) / 7)); left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); transform: none; max-width: none; justify-content: space-around; align-items: center; padding: 0 6px; gap: 0; border-radius: 20px; }
  .dock a[data-phone="0"], .dock-sep { display: none; }
  .dock .tip { display: none; }
  .dock a { min-width: 0; padding: 0; justify-content: center; }
  .dock a::after { bottom: 2px; }
  .task-tray { bottom: 82px; }

  .ps-btn { width: 38px; height: 40px; }
  .titlebar { padding: 0 9px; gap: 7px; }
  .titlebar .title { font-size: 13px; }
  .bar-btn { width: 36px; height: 36px; min-width: 36px; }

  .finder, .work-page, .files-page, .notes-page, .project-page { grid-template-columns: 1fr; }
  .sidebar, .notes-list { display: none; }
  .toolbar, .page-toolbar { flex-wrap: wrap; }
  .search { min-width: 80px; font-size: 14px; }
  .sort-select { width: 86px; font-size: 11px; }
  .context-menu { min-width: 240px; }
  .context-menu button { min-height: 42px; font-size: 14px; }
  .dialog-content { padding: 16px; }
  .shortcut-list p { grid-template-columns: 1fr 1fr; }
  .layout-grid { grid-template-columns: repeat(2, 1fr); }
  .window-switcher { grid-template-columns: 1fr; }
  .atmosphere-options { gap: 6px; }
  .atmosphere-swatch { height: 65px; }
  .focus-time { font-size: 60px; }
  .weather-current > strong { font-size: 52px; }
  .weather-current h3 { font-size: 21px; }
  .spotlight-results { max-height: 50dvh; }
  .btn, .link-btn { min-height: 40px; }
}

@media (max-width: 380px) {
  .status-battery span { display: none; }
}

.coffee-reserve { position: relative; }
.coffee-reserve i { position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #c68a4e var(--c), var(--hover) var(--c)); }

/* △ Focus mode */
.focus-veil { position: absolute; inset: 0; z-index: 890; background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(10px) saturate(.9); -webkit-backdrop-filter: blur(10px) saturate(.9); animation: veilIn .3s ease both; cursor: zoom-out; }
@keyframes veilIn { from { opacity: 0; } }
.window.is-focused, .app-window.is-focused { z-index: 900 !important; box-shadow: 0 40px 120px rgba(0, 0, 0, .55), 0 0 0 1px var(--line-strong); transition: left .35s var(--ease-out), top .35s var(--ease-out), width .35s var(--ease-out), height .35s var(--ease-out), box-shadow .3s; }
@media (min-width: 1100px) and (min-height: 640px) {
  .window.is-focused, .app-window.is-focused { position: absolute !important; left: 50% !important; top: 12px !important; width: min(1320px, calc(100% - 64px)) !important; height: calc(100% - 24px) !important; transform: translateX(-50%) !important; }
}
.ps-btn[aria-pressed="true"].ps-triangle { background: color-mix(in srgb, currentColor 18%, transparent); }
body.kos-window-focus .desktop-icons, body.kos-window-focus .task-tray { opacity: 0; pointer-events: none; transition: opacity .3s; }


/* ---------------------------------------------------------------------- */
/* Checker — the site's canvas                                              */
/* The transparency grid every designer knows from Photoshop and           */
/* Illustrator, in four layers that can each be switched off in the Studio */
/* panel (body.chk-details / chk-progress).                               */
/* ---------------------------------------------------------------------- */
:root { --chk-tone: rgba(255, 255, 255, .03); --chk-size: 56px; }
:root[data-theme="light"] { --chk-tone: rgba(0, 0, 0, .04); }
body[data-realm] { --chk-tone: rgba(255, 255, 255, .035); }
body[data-realm="field"] { --chk-tone: rgba(20, 20, 20, .065); }
body[data-realm="gallery"] { --chk-tone: rgba(49, 43, 39, .05); }
body[data-realm="motion"] { --chk-tone: rgba(197, 175, 255, .055); }
body[data-realm="stickers"] { --chk-tone: rgba(209, 245, 91, .04); }
@keyframes chkMarch { to { background-position: 12px 0; } }
@keyframes chkFlip { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(90deg); } }

/* Reveal transitions (menu-bar.js › chkReveal): quarter, half, three
   quarters of every tile, then the whole element. */
.chk-r1, .chk-r2, .chk-r3 { --chk-cell: 44px; -webkit-mask-size: var(--chk-cell) var(--chk-cell); mask-size: var(--chk-cell) var(--chk-cell); }
.chk-r1 { -webkit-mask-image: conic-gradient(#000 0 25%, transparent 0); mask-image: conic-gradient(#000 0 25%, transparent 0); }
.chk-r2 { -webkit-mask-image: repeating-conic-gradient(#000 0 25%, transparent 0 50%); mask-image: repeating-conic-gradient(#000 0 25%, transparent 0 50%); }
.chk-r3 { -webkit-mask-image: conic-gradient(#000 0 75%, transparent 0); mask-image: conic-gradient(#000 0 75%, transparent 0); }
.realm-room.chk-entering { position: relative; z-index: 1; background: var(--room-bg); }

/* 3 · Details: the active window's title bar, dock separators, menu rules. */
.chk-details .window.is-active > .titlebar, .chk-details .app-window > .titlebar { position: relative; }
.chk-details .window.is-active > .titlebar::after, .chk-details .app-window > .titlebar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 6px; pointer-events: none;
  background: repeating-conic-gradient(var(--text) 0 25%, transparent 0 50%) 0 0 / 6px 6px; opacity: .22;
}
.chk-details .dock-sep { width: 6px; background: repeating-conic-gradient(var(--text) 0 25%, transparent 0 50%) 0 0 / 6px 6px; opacity: .3; }
.chk-details .context-menu hr { height: 4px; border: 0; background: repeating-conic-gradient(var(--text) 0 25%, transparent 0 50%) 0 0 / 4px 4px; opacity: .2; }
.chk-details .menu-cta:hover { background-image: repeating-conic-gradient(rgba(0, 0, 0, .14) 0 25%, transparent 0 50%); background-size: 8px 8px; }

/* Motifs: the checker as the site's signature, in four places, each with
   a little motion. */
@keyframes chkDraw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes chkWave { 0%, 100% { transform: scale(1) skewY(0); } 30% { transform: scale(1.35) skewY(-14deg); } 60% { transform: scale(1.2) skewY(10deg); } }
/* 2 · Hero: a yellow checker tape under "brands." — drawn on arrival,
   marches while you hover the headline. */
.chk-details .st-hero h1 em { position: relative; display: inline-block; }
.chk-details .st-hero h1 em::after {
  content: ""; position: absolute; left: .02em; right: .06em; bottom: -.05em; height: .14em; pointer-events: none;
  background: repeating-conic-gradient(var(--st-yellow, #ffcf3e) 0 25%, transparent 0 50%) 0 0 / .14em .14em;
  animation: chkDraw .9s steps(14) .7s both;
}
.chk-details .st-hero h1:hover em::after { animation: chkMarch 1s linear infinite; background-size: .14em .14em; }
/* 3 · Room headings: the rule under every room's heading is a checker
   finish line, drawn left to right each time you enter the room. */
.chk-details .realm-room:not(#room-play) > .room-heading { border-bottom: 0; position: relative; }
.chk-details .realm-room:not(#room-play) > .room-heading::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 10px; pointer-events: none;
  background: repeating-conic-gradient(var(--room-ink) 0 25%, transparent 0 50%) 0 0 / 10px 10px;
  animation: chkDraw .7s steps(28) .15s both;
}
/* 5 · Dock: open apps carry a small checker flag instead of a dot; it
   waves when the app launches. */
.chk-details .dock a::after { width: 10px; height: 8px; margin-left: -5px; bottom: -1px; border-radius: 1px; background: repeating-conic-gradient(var(--accent) 0 25%, transparent 0 50%) 0 0 / 5px 4px; }
.chk-details .dock a.active::after { background: repeating-conic-gradient(var(--text) 0 25%, transparent 0 50%) 0 0 / 5px 4px; }
.chk-details .dock a.launch::after { animation: chkWave .6s ease-out; }
@media (prefers-reduced-motion: reduce) { .chk-details .st-hero h1 em::after, .chk-details .realm-room > .room-heading::after, .chk-details .dock a.launch::after { animation: none; } }

/* 4 · Progress & finish: bars march, windows load with a flipping tile,
   finished things get a finish-line strip. */
.chk-progress .st-progress > span i { background: repeating-conic-gradient(#1b1a14 0 25%, #ffc933 0 50%) 0 0 / 6px 6px; animation: chkMarch 1.2s linear infinite; }
.chk-progress .st-facts li i { height: 4px; bottom: -2px; background: repeating-conic-gradient(var(--st-ink, #141414) 0 25%, transparent 0 50%) 0 0 / 4px 4px; }
.chk-progress .coffee-reserve i { background: repeating-conic-gradient(#6b4423 0 25%, #d9a066 0 50%) 0 0 / 6px 6px; }
.chk-progress .window.is-loading > .titlebar .title::after {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 10px; vertical-align: -1px;
  background: repeating-conic-gradient(currentColor 0 25%, transparent 0 50%) 0 0 / 10px 10px; opacity: .7; animation: chkFlip .8s steps(2) infinite;
}
.chk-progress .bw-done { position: relative; padding-top: 30px; }
.chk-progress .bw-done::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; border-radius: 6px 6px 0 0; background: repeating-conic-gradient(currentColor 0 25%, transparent 0 50%) 0 0 / 12px 12px; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .chk-progress .st-progress > span i, .chk-progress .window.is-loading > .titlebar .title::after { animation: none; } }
/* ---- Dock die-cut line (A5): a magenta CutContour runs round the chip on hover ---- */
.dock-art svg.dock-cut { position: absolute; z-index: 2; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); pointer-events: none; overflow: visible; opacity: 0; transition: opacity .2s; }
.dock-cut rect { fill: none; stroke: #ff2fa0; stroke-width: 1.6; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; animation: dockCut 1.6s linear infinite paused; filter: drop-shadow(0 0 2px rgba(255, 47, 160, .45)); }
.dock a:hover .dock-cut, .dock a:focus-visible .dock-cut { opacity: 1; }
.dock a:hover .dock-cut rect, .dock a:focus-visible .dock-cut rect { animation-play-state: running; }
@keyframes dockCut { to { stroke-dashoffset: -14; } }
.dock a:hover .dock-art::before { content: "✂"; position: absolute; z-index: 3; left: -9px; top: -11px; font-size: 11px; line-height: 1; color: #ff2fa0; offset-path: inset(-5px round 14px); animation: dockScissor 2.4s linear infinite; text-shadow: 0 0 3px rgba(0, 0, 0, .4); }
@keyframes dockScissor { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@supports not (offset-path: inset(0)) { .dock a:hover .dock-art::before { display: none; } }
body.reduce-motion .dock-cut rect, body.reduce-motion .dock a:hover .dock-art::before { animation: none; }
/* ---- crumple into the bin (A6) ---- */
.fx-crumple { position: fixed; z-index: 9000; width: 54px; height: 66px; pointer-events: none; border-radius: 2px;
  background: repeating-linear-gradient(#fbfaf6 0 7px, #e7e3d9 7px 8px), #fbfaf6; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.fx-crumple::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .2s; background:
  radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .9), transparent 30%), radial-gradient(circle at 70% 70%, rgba(0, 0, 0, .28), transparent 45%),
  repeating-linear-gradient(35deg, transparent 0 6px, rgba(0, 0, 0, .12) 6px 7px), repeating-linear-gradient(-50deg, transparent 0 9px, rgba(0, 0, 0, .1) 9px 10px); }
.fx-crumple.is-balled::after { opacity: 1; }
.dock-trash.is-gulp .dock-art, .dk-bin.is-gulp .dk-bin-art { animation: binGulp .6s cubic-bezier(.3, .7, .4, 1.4); }
@keyframes binGulp { 0% { transform: none; } 25% { transform: scale(1.18, .82) translateY(3px); } 55% { transform: scale(.92, 1.1) translateY(-4px); } 80% { transform: scale(1.03, .97); } 100% { transform: none; } }
/* ---- menu-bar sound toggle ---- */
.status-sound svg { width: 17px; height: 17px; }
body.sound-off .status-sound { opacity: .55; }
/* ---- business card ---- */
.os-dialog.kc-dialog { width: min(640px, calc(100vw - 24px)); max-width: none; }
.kc-stage { perspective: 1400px; display: grid; place-items: center; padding: 22px 6px 6px; }
.kc-card { --rx: 0deg; --ry: 0deg; position: relative; width: min(500px, 100%); aspect-ratio: 85 / 55; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip, 0deg))); transition: transform .7s cubic-bezier(.3, .9, .3, 1); }
.kc-card.is-flipped { --flip: 180deg; }
.kc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 10px; }
.kc-face { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 24px 50px rgba(0, 0, 0, .45), 0 2px 0 rgba(255, 255, 255, .08) inset; text-align: left; }
.kc-front { background: radial-gradient(ellipse at 20% 0%, #24262b, #0d0e10 70%); color: #f3eee3; padding: 7% 8%; display: flex; flex-direction: column; }
.kc-logo { width: 19%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)); }
.kc-name { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.kc-name b { font-size: clamp(22px, 5.6vw, 34px); line-height: .95; letter-spacing: -.045em; font-weight: 800; }
.kc-name small { font-size: clamp(10px, 2.2vw, 13px); color: #a7a39a; }
.kc-line { margin-top: 5%; padding-top: 4%; border-top: 1px solid rgba(255, 255, 255, .14); font: 600 clamp(8.5px, 1.9vw, 11px) var(--font-mono); letter-spacing: .04em; color: #cfc9bd; }
.kc-bleed { position: absolute; right: 0; top: 0; bottom: 0; width: 9%; background: repeating-conic-gradient(#f3eee3 0 25%, transparent 0 50%) 0 0 / 14px 14px; }
.kc-back { transform: rotateY(180deg); background: #f3eee3; color: #141414; display: flex; align-items: center; gap: 7%; padding: 7% 8%; }
.kc-qr { width: 42%; height: auto; border-radius: 6px; flex: none; }
.kc-back-txt { display: flex; flex-direction: column; gap: 6px; } .kc-back-txt b { font-size: clamp(16px, 3.6vw, 22px); letter-spacing: .02em; } .kc-back-txt small { font: 600 clamp(9px, 2vw, 11px) var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #6b675f; }
.kc-crop { position: absolute; width: 12px; height: 12px; border: 0 solid rgba(127, 127, 127, .55); }
.kc-crop.tl { left: 6px; top: 6px; border-left-width: 1px; border-top-width: 1px; } .kc-crop.tr { right: 6px; top: 6px; border-right-width: 1px; border-top-width: 1px; }
.kc-crop.bl { left: 6px; bottom: 6px; border-left-width: 1px; border-bottom-width: 1px; } .kc-crop.br { right: 6px; bottom: 6px; border-right-width: 1px; border-bottom-width: 1px; }
.kc-front .kc-crop.tr, .kc-front .kc-crop.br { right: calc(9% + 6px); }
.kc-hint { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--text-muted); }
/* ---- Resolution (dpi.js) ---- */
.status-dpi { gap: 6px; font: 700 11px var(--font-mono) !important; letter-spacing: .04em; }
.status-dpi i { width: 11px; height: 11px; border-radius: 2px; background: repeating-conic-gradient(currentColor 0 25%, transparent 0 50%) 0 0 / 5.5px 5.5px; opacity: .8; }
.status-dpi[data-mode="72"] i { background-size: 11px 11px; }
.status-dpi[data-mode="outline"] i { background: none; border: 1.5px solid currentColor; }
.status-dpi[data-mode="blueprint"] i { background: #3d7bff; }
/* pixel modes reach everything below the menu bar; the bar itself stays crisp */
html[data-dpi="150"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .menu-pop, .context-menu) { filter: url(#dpi-150); }
html[data-dpi="72"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .menu-pop, .context-menu) { filter: url(#dpi-72); }
html.dpi-fallback[data-dpi="150"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .menu-pop, .context-menu) { filter: blur(.45px) contrast(1.06); }
html.dpi-fallback[data-dpi="72"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .menu-pop, .context-menu) { filter: blur(1.1px) contrast(1.15) saturate(.85); }
html.dpi-fallback img.dpi-px { image-rendering: pixelated; }
html[data-dpi-step="dpi-s2"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .context-menu) { filter: url(#dpi-s2) !important; }
html[data-dpi-step="dpi-s5"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .context-menu) { filter: url(#dpi-s5) !important; }
html[data-dpi-step="dpi-s6"]:not([data-embedded]) body > :not(.menu, .toast, .skip-link, svg, script, .dpi-scan, .context-menu) { filter: url(#dpi-s6) !important; }

.dpi-scan { position: fixed; inset: 0; z-index: 99999; pointer-events: none; background: linear-gradient(180deg, transparent 0, transparent calc(var(--p) - 2px), rgba(255, 47, 160, .9) var(--p), transparent calc(var(--p) + 40px)); animation: dpiScan .6s cubic-bezier(.5, 0, .3, 1) forwards; }
.dpi-scan[data-to="blueprint"] { background: linear-gradient(180deg, transparent 0, transparent calc(var(--p) - 2px), rgba(160, 205, 255, .95) var(--p), transparent calc(var(--p) + 40px)); }
@property --p { syntax: '<length-percentage>'; inherits: false; initial-value: 0%; }
@keyframes dpiScan { from { --p: 0%; } to { --p: 100%; } }
/* Outline view (⌘Y) — hairlines on white, no fills */
html[data-dpi="outline"] { background: #fff !important; color-scheme: light; }
html[data-dpi="outline"] body { background: #fff !important; }
html[data-dpi="outline"] body *:not(#_), html[data-dpi="outline"] body *:not(#_)::before, html[data-dpi="outline"] body *:not(#_)::after { background-color: transparent !important; background-image: none !important; color: #111 !important; border-color: rgba(0, 0, 0, .7) !important; box-shadow: none !important; text-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; filter: none !important; -webkit-mask: none !important; mask: none !important; mix-blend-mode: normal !important; }
html[data-dpi="outline"] body :is(div, section, article, aside, header, footer, nav, a, button, figure, li, ul, ol, form, input, textarea, select, iframe, canvas, video, dialog, label, main, table, td) { outline: 1px solid rgba(0, 0, 0, .55) !important; outline-offset: -1px !important; }
html[data-dpi="outline"] img { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0L100 100M100 0L0 100' stroke='%23111' stroke-width='1' vector-effect='non-scaling-stroke' fill='none'/%3E%3Crect x='.5' y='.5' width='99' height='99' fill='none' stroke='%23111' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); object-fit: fill !important; opacity: 1 !important; }
html[data-dpi="outline"] video, html[data-dpi="outline"] canvas { opacity: 0 !important; }
html[data-dpi="outline"] svg *, html[data-dpi="blueprint"] svg * { fill: none !important; stroke: currentColor !important; stroke-width: 1px !important; vector-effect: non-scaling-stroke; }
html[data-dpi="outline"] svg text, html[data-dpi="blueprint"] svg text { fill: currentColor !important; stroke: none !important; }
/* Blueprint */
html[data-dpi="blueprint"] { background: #0d3b8c !important; color-scheme: dark; }
html[data-dpi="blueprint"] body { background: linear-gradient(rgba(220, 235, 255, .16) 1px, transparent 1px) 0 0 / 100px 100px, linear-gradient(90deg, rgba(220, 235, 255, .16) 1px, transparent 1px) 0 0 / 100px 100px, linear-gradient(rgba(220, 235, 255, .07) 1px, transparent 1px) 0 0 / 20px 20px, linear-gradient(90deg, rgba(220, 235, 255, .07) 1px, transparent 1px) 0 0 / 20px 20px, #0d3b8c !important; }
html[data-dpi="blueprint"] body *:not(#_), html[data-dpi="blueprint"] body *:not(#_)::before, html[data-dpi="blueprint"] body *:not(#_)::after { background-color: transparent !important; background-image: none !important; color: #e9f1ff !important; border-color: rgba(233, 241, 255, .6) !important; box-shadow: none !important; text-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; filter: none !important; -webkit-mask: none !important; mask: none !important; mix-blend-mode: normal !important; }
html[data-dpi="blueprint"] body :is(div, section, article, aside, header, footer, nav, a, button, figure, li, ul, ol, form, input, textarea, select, iframe, canvas, video, dialog, label, main, table, td) { outline: 1px solid rgba(233, 241, 255, .45) !important; outline-offset: -1px !important; }
html[data-dpi="blueprint"] img { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0L100 100M100 0L0 100' stroke='%23e9f1ff' stroke-opacity='.7' stroke-width='1' vector-effect='non-scaling-stroke' fill='none'/%3E%3Crect x='.5' y='.5' width='99' height='99' fill='none' stroke='%23e9f1ff' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); object-fit: fill !important; opacity: 1 !important; }
html[data-dpi="blueprint"] video, html[data-dpi="blueprint"] canvas { opacity: 0 !important; }
html[data-dpi="blueprint"] body .dpi-measure:not(#_), html[data-dpi="blueprint"] body .dpi-measure *:not(#_) { outline: none !important; }
.dpi-measure { position: fixed; z-index: 99998; pointer-events: none; }
html body .dpi-measure:not(#_) { border: 1px dashed #ffd84a !important; }
html body .dpi-measure i:not(#_), html body .dpi-measure i:not(#_)::after { border-color: #ffd84a !important; }
.dpi-measure i { position: absolute; border-color: #ffd84a !important; }
.dpi-measure i.w { left: 0; right: 0; top: -12px; height: 7px; border: 1px solid; border-top: 0; border-bottom: 0; }
.dpi-measure i.w::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 1px solid #ffd84a; }
.dpi-measure i.h { top: 0; bottom: 0; left: -12px; width: 7px; border: 1px solid; border-left: 0; border-right: 0; }
.dpi-measure i.h::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; border-left: 1px solid #ffd84a; }
html body .dpi-measure b, html[data-dpi="blueprint"] body .dpi-measure b:not(#_) { position: absolute; left: 50%; top: -30px; translate: -50% 0; padding: 2px 7px; border-radius: 4px; background-color: #ffd84a !important; color: #0d3b8c !important; font: 700 10.5px var(--font-mono); white-space: nowrap; }
/* ---- Quick Look (quicklook.js) ---- */
.ql { position: fixed; inset: 0; z-index: 9800; display: grid; place-items: center; }
.ql-backdrop { position: absolute; inset: 0; background: rgba(6, 7, 10, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ql-win { position: relative; width: min(980px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 120px)); display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: rgba(28, 30, 36, .86); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 40px 100px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%); color: #f1f3f7; transform-origin: 50% 50%; }
.ql-bar { flex: none; display: grid; grid-template-columns: 36px 1fr auto auto; align-items: center; gap: 12px; height: 52px; padding: 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ql-x { width: 14px; height: 14px; border-radius: 50%; border: 0; background: #ff5f57; cursor: pointer; position: relative; padding: 0; }
.ql-x::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px/1 var(--font-sans); color: rgba(60, 0, 0, .7); opacity: 0; }
.ql-x:hover::after, .ql-x:focus-visible::after { opacity: 1; }
.ql-title { min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.ql-title b { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-title small { font: 600 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #9aa1ad; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-count { font: 600 11px var(--font-mono); color: #9aa1ad; font-variant-numeric: tabular-nums; }
.ql-open { height: 30px; padding: 0 14px; border-radius: 8px; border: 0; background: #f1f3f7; color: #15171b; font: 650 12.5px var(--font-sans); cursor: pointer; }
.ql-open:focus-visible, .ql-nav:focus-visible { outline: 2px solid #ffcf3e; outline-offset: 2px; }
.ql-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ql-page { position: absolute; inset: 0; overflow: auto; padding: 22px 26px; display: grid; place-items: center; }
.ql-page > * { max-width: 100%; }
.ql-nav { position: absolute; top: 50%; z-index: 3; width: 38px; height: 54px; margin-top: -1px; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .35); color: #fff; font: 300 30px/1 var(--font-sans); cursor: pointer; opacity: .55; transition: opacity .2s, background .2s; }
.ql-nav:hover { opacity: 1; background: rgba(0, 0, 0, .6); }
.ql-nav.prev { left: 10px; } .ql-nav.next { right: 10px; }
/* content kinds — all inside the same stage */
.ql-grid { width: 100%; align-self: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.ql-grid figure { margin: 0; animation: qlIn .4s cubic-bezier(.2, .9, .25, 1) both; animation-delay: calc(var(--i) * 30ms); }
.ql-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.ql-grid figcaption { display: flex; justify-content: space-between; gap: 8px; padding-top: 7px; font-size: 12.5px; } .ql-grid small { color: #9aa1ad; }
@keyframes qlIn { from { opacity: 0; transform: translateY(8px); } }
.ql-list { width: min(620px, 100%); align-self: start; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ql-list li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 13.5px; }
.ql-list li span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: rgba(255, 255, 255, .1); font: 800 12px var(--font-sans); }
.ql-list small { color: #9aa1ad; }
.ql-empty { color: #9aa1ad; font-size: 14px; }
.ql-project { width: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: stretch; }
.ql-hero { display: grid; place-items: center; min-height: 0; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .25); }
.ql-hero img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ql-project aside { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.ql-project aside p { margin: 0; font-size: 15px; line-height: 1.5; } .ql-dim { color: #9aa1ad; font-size: 13px !important; }
.ql-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.ql-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; aspect-ratio: 1; }
.ql-thumbs button.on { border-color: #ffcf3e; } .ql-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ql-generic { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ql-generic b { font-size: 22px; } .ql-generic p { margin: 0; color: #cfd4dc; max-width: 460px; } .ql-generic code { font: 12px var(--font-mono); color: #9aa1ad; word-break: break-all; }
.ql-glyph, .ql-art { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 24px; background: rgba(255, 255, 255, .08); font: 800 40px var(--font-sans); }
.ql-art > * { width: 88px !important; height: 88px !important; margin: 0 !important; }
.ql-pdf { display: flex; gap: 18px; justify-content: center; height: 100%; align-items: center; }
.ql-sheet { position: relative; height: min(100%, 460px); aspect-ratio: 1 / 1.414; background: #f6f2ea; color: #141414; padding: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); display: flex; flex-direction: column; }
.ql-sheet img { width: 46px; } .ql-sheet h3 { margin: auto 0 6px; font-size: 34px; line-height: .95; letter-spacing: -.04em; } .ql-sheet p { margin: 0; font-size: 11px; color: #555; } .ql-sheet > span { position: absolute; right: 18px; top: 18px; font: 700 11px var(--font-mono); }
.ql-sheet2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; } .ql-sheet2 img { width: 100%; height: 100%; object-fit: cover; }
.ql-ai { width: min(820px, 100%); display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: center; }
.ql-board { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 10px; background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 0 0 / 18px 18px; color: #ff9a3d; font: 900 26px var(--font-sans); }
.ql-board b { padding: 10px 14px; background: #2b1300; border-radius: 6px; }
.ql-ai dl { margin: 0; } .ql-ai dl div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px; }
.ql-ai dt { color: #9aa1ad; font: 600 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; } .ql-ai dd { margin: 0; text-align: right; }
.ql-txt { width: min(640px, 100%); height: 100%; background: #fbfaf7; color: #1b1b1b; border-radius: 8px; padding: 30px 34px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); overflow: auto; }
.ql-txt pre { margin: 0; white-space: pre-wrap; font: 14px/1.7 var(--font-mono); }
.ql-cards { display: flex; gap: 20px; justify-content: center; align-items: center; width: 100%; flex-wrap: wrap; }
.ql-cards .kc-face { position: relative; inset: auto; width: min(400px, 46%); aspect-ratio: 85 / 55; transform: none; backface-visibility: visible; }
@media (max-width: 760px) { .ql-project { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .ql-ai { grid-template-columns: 1fr; } .ql-cards .kc-face { width: 100%; } .ql-nav { display: none; } }
@media (max-width: 1640px) { .status-weather [data-weather-label] { display: none; } }
.fx-restored { animation: fxRestored .6s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes fxRestored { 0% { opacity: 0; scale: .4; } 60% { opacity: 1; scale: 1.08; } 100% { scale: 1; } }

/* wallpaper thumbnails (System and the menu-bar picker) */
.wp-thumb { display: block; aspect-ratio: 16 / 10; border-radius: 8px; background: #15171b; position: relative; overflow: hidden; }
.wp-cut { background: linear-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px) 0 0 / 14px 14px, linear-gradient(90deg, rgba(255, 255, 255, .14) 1px, transparent 1px) 0 0 / 14px 14px, #1d4a3a; }
.wp-daylight { background: linear-gradient(180deg, #d9b79a, #7f9fbd); }
.wp-daylight::after { content: ""; position: absolute; left: 60%; top: 22%; width: 14px; height: 14px; border-radius: 50%; background: #fff3d6; box-shadow: 0 0 18px 8px rgba(255, 236, 200, .7); }
.status-wall svg { width: 17px; height: 17px; }
.wall-pop { position: fixed; z-index: 9700; width: 360px; padding: 12px; border-radius: 16px; background: rgba(24, 26, 32, .92); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); color: #f1f3f7; animation: wallPop .22s cubic-bezier(.2, .9, .3, 1.2); transform-origin: 90% 0; }
@keyframes wallPop { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
.wall-pop header { font: 700 10px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: #9aa1ad; padding: 2px 4px 10px; }
.wall-pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wall-pop-grid button { display: flex; flex-direction: column; gap: 6px; padding: 5px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: #cfd4dc; font: 600 11.5px var(--font-sans); cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.wall-pop-grid button:hover { background: rgba(255, 255, 255, .06); }
.wall-pop-grid button.on { border-color: #ffcf3e; color: #fff; }
.wall-pop-grid button:focus-visible { outline: 2px solid #ffcf3e; outline-offset: 1px; }
@media (max-width: 640px) { .wall-pop { width: calc(100vw - 16px); } }
@media (max-width: 1520px) { .menu-status .status-spaces { display: none; } .menu-status .status-button { padding-left: 7px; padding-right: 7px; } }
@media (max-width: 1360px) { .menu-status .status-calendar [data-date] { display: none; } }
.wp-studio { background: url('../assets/home/studio-scene-v131.webp') center / cover; filter: blur(1.5px) brightness(.7); }
.wp-graphite { background: linear-gradient(160deg, #2b2e35, #121317); }
/* ---- Phone: the whole dock, scrollable, with names under the icons ---- */
@media (max-width: 600px) {
  :root { --dock-h: 74px; }
  .dock { --icon: 42px; justify-content: flex-start; align-items: flex-end; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; padding: 6px 10px 6px; gap: 0;
    -webkit-mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent); mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent); }
  .dock::-webkit-scrollbar { display: none; }
  .dock { background: var(--dock-bg); backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); border: 1px solid var(--line); }
  .dock::before { display: none; }
  .dock a, .dock a[data-phone="0"], .dock .dock-trash { display: flex; flex: 0 0 64px; min-width: 64px; padding: 0 0 2px; gap: 4px; justify-content: flex-end; scroll-snap-align: start; }
  .dock .is-hidden-app { display: none; }
  .dock-sep { display: none; }
  .dock .tip { display: block; max-width: 62px; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; text-align: center; }
  .dock a::after { bottom: auto; top: 0; }
  .dock-art svg.dock-cut, .dock a:hover .dock-art::before { display: none; }
  /* top bar: keep it on one line */
  .menu-status .status-wall, .menu-status .status-sound, .menu-status .status-weather { display: none; }
  .menu-status .status-dpi span { display: none; }
  .menu-status .status-dpi { min-width: 32px; }
  .language-button { min-width: 34px !important; font-size: 0 !important; }
  .language-button::after { content: attr(data-short); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
  .menu-status { gap: 0; }
}
/* the pixel filter makes the desktop the frame for fixed layers; the Studio's photo-locked layers are measured from the screen top, so lift them back by the menu height */
html:is([data-dpi="150"], [data-dpi="72"], [data-dpi-step]):not([data-embedded]) :is(.st-scene, .st-wall, .st-shelf) { margin-top: calc(-1 * var(--menu-h, 48px)); }
html:is([data-dpi="150"], [data-dpi="72"], [data-dpi-step]):not([data-embedded]) :is(.st-dark, .st-torch) { top: calc(-1 * var(--menu-h, 48px)); bottom: auto; height: 100vh; }
.wp-court { background: url('../assets/home/court-v2-thumb.webp') center / cover; }
