/* shell.css — the desktop shell (§7.8, §9.5): desktop, windows, taskbar, start, palette, notifications, lock, login. */

/* ── R9 · layout hooks for the second edition (G1.S S8; REDESIGN_PLAN_FINAL §2.1.2–§2.1.3, D-7; Appendix W.8) ───────────────
   The desk's insets as variables, so the rail, the Inspector and the Filing tray find their places in ONE spot and the
   work-area contract (js/core/workarea.js) reads the same numbers the layers are drawn with. `data-edition` on <html> is
   painted by js/core/edition.js: absent or "classic" = the first edition's desk, every inset exactly what it was before this
   block (nothing moves); "second" = the places rail takes its width off the left. Layer geometry that is JS-driven stays
   JS-driven (desktop.js sets the icon and widget layers' left edge from workarea.area(); window rects are viewport
   coordinates) — these variables never move a window.
     --desk-inset-top | -right | -bottom | -left   the part of the viewport the desk's layers leave to the chrome
     --rail-w                                       tokens.css (72 · 64 compact · 80/88 larger text); 48px when collapsed
     --inspector-w                                  the Inspector's width (overlay; docked at >= 1600px: it takes the right inset)
     --tray-pop-w | --tray-pop-bottom               the Filing tray's popover from the taskbar badge
     --z-rail | --z-inspector                       above the windows' layer, below the taskbar and the flyouts            */
:root {
  --desk-inset-top: 0px;
  --desk-inset-right: 0px;
  --desk-inset-bottom: calc(var(--taskbar-h) + 16px);   /* = workarea.js BELOW_GAP above the taskbar */
  --desk-inset-left: 0px;
  --inspector-w: 380px;
  --tray-pop-w: 360px;
  --tray-pop-bottom: calc(var(--taskbar-h) + 22px);
  --z-rail: 10000;
  --z-inspector: 10050;
}
:root[data-edition="second"] { --desk-inset-left: var(--rail-w); }
:root[data-rail="collapsed"] { --rail-w: 48px; }          /* the rail collapsed to glyphs; workarea.js follows its width */
@media (min-width: 1600px) {
  :root[data-edition="second"][data-inspector="docked"] { --desk-inset-right: var(--inspector-w); }
}
/* the classic guard: whatever else mounts it, a rail on the first edition's desk takes no room and shows nothing, so
   workarea.railWidth() reads 0 and the insets stay the first edition's */
:root:not([data-edition="second"]) :is(.w2-rail, [data-w2-rail], nav[aria-label="Places"]) { display: none !important; }

/* ── desktop layers ──────────────────────────────────────────────────────────────────────── */
.w2-desktop { position: absolute; inset: 0; overflow: hidden; }
.w2-desk-icons { position: absolute; inset: var(--desk-inset-top) var(--desk-inset-right) var(--desk-inset-bottom) 0; z-index: var(--z-desktop-icons); pointer-events: none; }
.w2-desk-icons > * { pointer-events: auto; }
.w2-widgets { position: absolute; inset: var(--desk-inset-top) var(--desk-inset-right) var(--desk-inset-bottom) 0; z-index: var(--z-widgets); pointer-events: none; }
.w2-desk-ext { position: absolute; inset: var(--desk-inset-top) var(--desk-inset-right) var(--desk-inset-bottom) 0; pointer-events: none; z-index: var(--z-widgets); }
.w2-desk-ext[data-layer="stickies"] { z-index: var(--z-stickies); }
.w2-windows { position: absolute; left: 0; right: 0; top: 0; height: calc(100% - var(--desk-inset-bottom)); pointer-events: none; z-index: var(--z-window-base); }
.w2-workspace { position: absolute; inset: 0; pointer-events: none; visibility: hidden; }
.w2-workspace.is-active { visibility: visible; }
.w2-workspace > .w2-window { pointer-events: auto; }
.w2-workspace.is-entering { visibility: visible; animation: w2-ws-in var(--dur-base) var(--ease-out) both; }
.w2-workspace.is-leaving { visibility: visible; animation: w2-ws-out var(--dur-base) var(--ease-out) both; pointer-events: none; }
.w2-workspace.is-leaving > .w2-window { pointer-events: none; }
@keyframes w2-ws-in { from { opacity: 0; transform: translateX(calc(var(--ws-dir, 1) * 24px)); } to { opacity: 1; transform: none; } }
@keyframes w2-ws-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(calc(var(--ws-dir, 1) * -24px)); } }
.w2-overlays { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-startmenu); }
.w2-overlays > * { pointer-events: auto; }

/* locked: windows, stickies and widgets hidden; the lock overlay sits over the bare wallpaper (§4.8) */
/* every descendant too: a child's own `visibility: visible` would otherwise show through a hidden parent */
.w2-locked .w2-windows, .w2-locked .w2-windows *, .w2-locked .w2-desk-ext, .w2-locked .w2-desk-ext *,
.w2-locked .w2-widgets, .w2-locked .w2-widgets *, .w2-locked .w2-desk-icons, .w2-locked .w2-desk-icons *,
.w2-locked .w2-taskbar, .w2-locked .w2-taskbar *, .w2-locked .w2-overlays, .w2-locked .w2-overlays *,
.w2-locked body > :not(#w2-root), .w2-locked body > :not(#w2-root) * { visibility: hidden !important; }
/* (body-level layers — app-modal dialogs, menus, tooltips, previews, tab ghosts — paint above #w2-root's stacking
   context, lock overlay included, so they are hidden wholesale while locked; auth.js also makes them inert) */

/* ── windows ─────────────────────────────────────────────────────────────────────────────── */
.w2-window {
  position: absolute; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-radius: var(--r-window); overflow: hidden; isolation: isolate;
  background: var(--surface-solid); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-window);
  transform-origin: 50% 40%;
  contain: layout;
}
.w2-window.is-focused {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--shadow-window-focus);
  border-color: color-mix(in srgb, var(--accent), transparent 72%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .w2-window.is-focused, .w2-taskbar, .ui-menu, .w2-start, .w2-palette, .w2-toast, .w2-centre, .w2-flyout, .w2-preview, .ui-dialog, .w2-auth__card, .w2-lock__card { background: var(--surface-solid) !important; }
}
.w2-window.is-maximized { border-radius: 0; border-width: 0 0 1px 0; box-shadow: none; }
.w2-window.is-snapped { border-radius: var(--r-4); }
.w2-window.is-opening { animation: w2-win-open var(--dur-base) var(--ease-out) both; animation-delay: var(--w2-open-delay, 0ms); }
.w2-window.is-closing { animation: w2-win-close var(--dur-fast) var(--ease-in) both; pointer-events: none; }
@keyframes w2-win-open { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes w2-win-close { to { opacity: 0; transform: scale(.96); } }
.w2-window.is-animating { transition: left var(--dur-base) var(--ease-out), top var(--dur-base) var(--ease-out), width var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out), border-radius var(--dur-base); }
.w2-window.is-flying { transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out); transform-origin: 0 0; pointer-events: none; }
.w2-window.is-flying[style*="scale"] { opacity: 0; }
.w2-window.is-instant { transition: none !important; transform-origin: 0 0; }
.w2-window.is-instant[style*="scale"] { opacity: 0; }   /* un-minimise fades in as it flies out of the taskbar (V-16) */
.w2-window:focus-visible { outline: none; }              /* the focused window already wears its accent ring */
.w2-window.is-minimized { visibility: hidden; pointer-events: none; }
.w2-window.is-dragging { z-index: 9600 !important; will-change: transform; transition: none; box-shadow: 0 40px 100px rgba(0, 0, 0, .55), 0 0 0 1px var(--accent-ring); cursor: grabbing; }
.w2-window.is-dragging .w2-window__body, .w2-window.is-resizing .w2-window__body { pointer-events: none; }
.w2-is-dragging iframe, .w2-is-resizing iframe { pointer-events: none; }
.w2-is-resizing { user-select: none; }
.w2-window.is-flashing .w2-titlebar { animation: w2-attn 1s var(--ease-inout) 3; }
@keyframes w2-attn { 50% { background: var(--accent-weak); } }
.w2-peeking .w2-window:not(.is-peek):not(.is-minimized) { opacity: .08; transition: opacity var(--dur-base); }
.w2-peeking .w2-window.is-peek { opacity: 1; box-shadow: var(--shadow-window-focus); transition: opacity var(--dur-base); }

.w2-titlebar {
  position: relative; display: flex; align-items: center; gap: 10px; flex: none;
  height: var(--titlebar-h); padding: 0 6px 0 10px; user-select: none; cursor: default;
  border-bottom: 1px solid var(--line-1);
  background: linear-gradient(180deg, var(--w2-highlight), transparent 70%);
}
.w2-window.is-focused .w2-titlebar::after { content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent), transparent 35%), transparent); }
.w2-titlebar__plate { transition: filter var(--dur-fast); }
.w2-window:not(.is-focused) .w2-titlebar__plate { filter: saturate(.35) opacity(.75); }
.w2-titlebar__text { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.w2-titlebar__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-window:not(.is-focused) .w2-titlebar__title { color: var(--text-2); }
.w2-titlebar__status { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-titlebar__busy { display: grid; place-items: center; }
.w2-titlebar__badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--text-on-accent); font-size: 10.5px; font-weight: var(--fw-bold); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.w2-titlebar__controls { display: flex; align-items: center; gap: 2px; flex: none; }
.w2-wbtn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--text-3); transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-instant); }
.w2-window.is-focused .w2-wbtn { color: var(--text-2); }
.w2-wbtn:hover { background: var(--w2-hover); color: var(--text-1); }
.w2-wbtn:active { transform: scale(.92); }
.w2-wbtn--close:hover { background: var(--danger); color: #fff; }
:root[data-density="compact"] .w2-wbtn { width: 24px; height: 24px; }

.w2-window__body { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: hidden; background: var(--surface-content); color: var(--text-1); }
.w2-window__body--error { align-items: center; justify-content: center; overflow: auto; }
.w2-window__loading { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: color-mix(in srgb, var(--surface-content), transparent 15%); animation: w2-fade-in var(--dur-base) var(--ease-out); }
.w2-window__strip { flex: none; }
.w2-window__cstrip { border-radius: 0; }
.w2-window.is-maximized .w2-window__strip .ui-cstrip { border-radius: 0; }
.w2-window__ribbon { display: flex; align-items: center; gap: 8px; flex: none; padding: 5px 8px 5px 12px; background: var(--danger-bg); border-bottom: 1px solid color-mix(in srgb, var(--danger), transparent 70%); color: var(--danger); font-size: var(--fs-sm); }
.w2-window__ribbon-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }

/* eight resize handles */
.w2-rz { position: absolute; z-index: 40; touch-action: none; }
.w2-rz--n, .w2-rz--s { left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
.w2-rz--n { top: -3px; } .w2-rz--s { bottom: -3px; }
.w2-rz--e, .w2-rz--w { top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
.w2-rz--e { right: -3px; } .w2-rz--w { left: -3px; }
.w2-rz--ne, .w2-rz--nw, .w2-rz--se, .w2-rz--sw { width: 14px; height: 14px; }
.w2-rz--ne { top: -4px; right: -4px; cursor: nesw-resize; } .w2-rz--sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.w2-rz--nw { top: -4px; left: -4px; cursor: nwse-resize; } .w2-rz--se { bottom: -4px; right: -4px; cursor: nwse-resize; }
.w2-window.is-maximized .w2-rz { display: none; }
.w2-window { overflow: visible; }
.w2-window > .w2-titlebar { border-radius: var(--r-window) var(--r-window) 0 0; }
.w2-window > .w2-window__body:last-of-type, .w2-window > .w2-window__strip { border-radius: 0 0 calc(var(--r-window) - 1px) calc(var(--r-window) - 1px); }
.w2-window.is-maximized > .w2-titlebar, .w2-window.is-maximized > .w2-window__body, .w2-window.is-maximized > .w2-window__strip { border-radius: 0; }
.w2-window > .w2-window__strip .ui-cstrip { border-radius: 0 0 calc(var(--r-window) - 1px) calc(var(--r-window) - 1px); }
.w2-window:has(> .w2-window__strip) > .w2-window__body { border-radius: 0; }
html[data-resize-dir="n"], html[data-resize-dir="s"] { cursor: ns-resize; }
html[data-resize-dir="e"], html[data-resize-dir="w"] { cursor: ew-resize; }
html[data-resize-dir="ne"], html[data-resize-dir="sw"] { cursor: nesw-resize; }
html[data-resize-dir="nw"], html[data-resize-dir="se"] { cursor: nwse-resize; }

/* snap preview */
.w2-snap-preview { position: absolute; z-index: var(--z-snap-preview); left: 0; top: 0; width: 0; height: 0; border-radius: var(--r-4); pointer-events: none; opacity: 0; background: color-mix(in srgb, var(--accent), transparent 86%); border: 1px solid color-mix(in srgb, var(--accent), transparent 45%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 50px rgba(0, 0, 0, .3); backdrop-filter: blur(10px) saturate(130%); -webkit-backdrop-filter: blur(10px) saturate(130%); transition: left var(--dur-base) var(--ease-out), top var(--dur-base) var(--ease-out), width var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out), opacity var(--dur-fast); }
.w2-snap-preview.is-on { opacity: 1; }
.w2-snap-preview.is-instant { transition: none; }

/* ── desktop icons ───────────────────────────────────────────────────────────────────────── */
.w2-dicon { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 88px; padding: 8px 4px 6px; border-radius: var(--r-3); border: 1px solid transparent; color: var(--w2-desk-text); transition: background-color var(--dur-fast), transform var(--dur-base) var(--ease-out), border-color var(--dur-fast); touch-action: none; }
.w2-dicon:hover { background: rgba(255, 255, 255, .06); }
:root[data-theme="light"] .w2-dicon:hover { background: rgba(255, 255, 255, .4); }
.w2-dicon.is-selected { background: color-mix(in srgb, var(--accent), transparent 82%); border-color: color-mix(in srgb, var(--accent), transparent 55%); }
.w2-dicon.is-dragging { transition: none; z-index: 5; cursor: grabbing; background: color-mix(in srgb, var(--surface-2), transparent 30%); border-color: var(--line-2); box-shadow: var(--shadow-3); }
.w2-dicon.is-dragging .ui-plate { transform: translateY(-2px) scale(1.06); }
.w2-dicon.is-instant { transition: none; }
.w2-desk-icons.is-arranging .w2-dicon:not(.is-dragging) { transition: transform var(--dur-slow) var(--ease-out), background-color var(--dur-fast); }
.w2-desk-icons.is-arranging .w2-dicon:not(.is-dragging):hover { background: transparent; }
/* the drop slot while an icon is dragged: a soft engraved well where it will land */
.w2-desk-icons > .w2-dicon-slot { position: absolute; left: 0; top: 0; width: 88px; height: 96px; border-radius: var(--r-3); pointer-events: none; opacity: 0; border: 1px dashed color-mix(in srgb, var(--accent), transparent 45%); background: color-mix(in srgb, var(--accent), transparent 90%); box-shadow: inset 0 0 18px color-mix(in srgb, var(--accent), transparent 85%); transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast); }
.w2-desk-icons > .w2-dicon-slot.is-on { opacity: 1; }
.w2-dicon .ui-plate { transition: transform var(--dur-fast) var(--ease-spring); }
.w2-dicon:hover .ui-plate { transform: translateY(-2px); }
.w2-dicon__label { max-width: 100%; font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1.25; text-align: center; text-shadow: var(--w2-desk-shadow); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* round-3 integration (WP-ACCESS residual): a single long word ("Correspondence") uses the cell's padding and breaks
   (hyphenated where the browser can) instead of being clipped at the default size too */
.w2-dicon__label { width: calc(100% + 8px); max-width: none; margin: 0 -4px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
/* round 3 (WP-ACCESS): larger text keeps the icon inside its fixed grid cell (iconflow's 88 × 96): the label grows, the
   padding and gap give way, the label may use the gutter between cells, and a word longer still breaks rather than clips, and the label never outgrows two lines of 15 px */
:root[data-text="115"] .w2-dicon, :root[data-text="130"] .w2-dicon { gap: 4px; padding: 4px 0 3px; }
:root[data-text="115"] .w2-dicon__label, :root[data-text="130"] .w2-dicon__label { width: calc(100% + 8px); max-width: none; margin: 0 -4px; font-size: min(var(--fs-xs), 15px); line-height: 1.15; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
/* an app-level badge (os.setAppBadge): a count bubble on the plate's top-right corner, like the taskbar's */
.w2-dicon__badge { position: absolute; top: 3px; left: calc(50% + 14px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-size: 10.5px; font-weight: var(--fw-bold); color: var(--text-on-accent); background: var(--accent); box-shadow: 0 0 0 2px var(--surface-solid), var(--shadow-1); font-variant-numeric: tabular-nums; pointer-events: none; }

/* ── the clock widget ────────────────────────────────────────────────────────────────────── */
.w2-clockw { position: absolute; bottom: 20px; right: 34px; text-align: right; color: var(--w2-desk-text); text-shadow: var(--w2-desk-shadow); pointer-events: none; user-select: none; animation: w2-fade-in var(--dur-deliberate) var(--ease-out); }
.w2-clockw__time { font-family: var(--font-display); font-size: var(--fs-5xl); font-weight: 300; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w2-clockw__date { margin-top: 6px; font-family: var(--font-serif); font-size: var(--fs-xl); font-style: italic; color: color-mix(in srgb, var(--w2-desk-text), var(--accent) 25%); }
.w2-clockw__meta { margin-top: 4px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; opacity: .6; }

/* ── taskbar ─────────────────────────────────────────────────────────────────────────────── */
.w2-taskbar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: var(--z-taskbar);
  display: flex; align-items: center; gap: 6px; height: var(--taskbar-h); padding: 0 8px;
  border-radius: var(--r-5); background: var(--surface-2); border: 1px solid var(--line-1);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--w2-highlight);
  animation: w2-tb-in var(--dur-deliberate) var(--ease-out) both;
}
.w2-taskbar::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent), transparent 30%) 30%, color-mix(in srgb, var(--accent), transparent 30%) 70%, transparent); pointer-events: none; }
@keyframes w2-tb-in { from { transform: translateY(24px); opacity: 0; } }
.w2-taskbar__sep { width: 1px; height: 24px; background: var(--line-2); flex: none; margin: 0 2px; }
.w2-taskbar__spacer { flex: 1; }
.w2-taskbar__start { display: grid; place-items: center; width: calc(var(--taskbar-h) - 12px); height: calc(var(--taskbar-h) - 12px); border-radius: var(--r-4); flex: none; transition: background-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.w2-taskbar__start:hover { background: var(--w2-hover); }
.w2-taskbar__start:active { transform: scale(.94); }
.w2-seal { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #2b1d06; background: radial-gradient(circle at 36% 28%, #f6dc9a, #d4a94f 45%, #7c5a1c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 4px rgba(60, 40, 5, .45), 0 0 0 1px rgba(90, 64, 15, .6), 0 4px 14px -4px rgba(212, 169, 79, .7); transition: box-shadow var(--dur-base), transform var(--dur-base) var(--ease-spring); }
:root[data-density="compact"] .w2-seal { width: 30px; height: 30px; }
.w2-taskbar__start:hover .w2-seal, .w2-taskbar__start.is-open .w2-seal { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 4px rgba(60, 40, 5, .45), 0 0 0 1px rgba(90, 64, 15, .6), 0 0 22px rgba(212, 169, 79, .55); transform: rotate(-8deg); }
.w2-taskbar__ws { display: flex; align-items: center; gap: 2px; }
.w2-wsdot { display: grid; place-items: center; width: 22px; height: 30px; border-radius: 6px; }
.w2-wsdot:hover { background: var(--w2-hover); }
.w2-wsdot__dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); transition: background-color var(--dur-base), border-color var(--dur-base), transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base); }
.w2-wsdot.has-windows .w2-wsdot__dot { border-color: var(--text-2); background: color-mix(in srgb, var(--text-2), transparent 70%); }
.w2-wsdot.is-active .w2-wsdot__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.2); box-shadow: 0 0 10px var(--accent-ring); }
.w2-taskbar__appswrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.w2-taskbar__apps { display: flex; align-items: center; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
:root[data-motion="reduced"] .w2-taskbar__apps { scroll-behavior: auto; }
.w2-taskbar__apps.has-more-end { -webkit-mask-image: linear-gradient(90deg, black calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, black calc(100% - 32px), transparent); }
.w2-taskbar__apps.has-more-start { -webkit-mask-image: linear-gradient(90deg, transparent, black 32px); mask-image: linear-gradient(90deg, transparent, black 32px); }
.w2-taskbar__apps.has-more-start.has-more-end { -webkit-mask-image: linear-gradient(90deg, transparent, black 32px, black calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent, black 32px, black calc(100% - 32px), transparent); }
.w2-taskbar__divider { width: 1px; height: 24px; margin: 0 5px; flex: none; background: linear-gradient(180deg, transparent, var(--line-3), transparent); }
.w2-taskbar__more { position: relative; display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 9px 0 7px; border-radius: var(--r-pill); flex: none; color: var(--text-2); background: var(--surface-sunken); border: 1px solid var(--line-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.w2-taskbar__more:hover, .w2-taskbar__more[aria-expanded="true"] { background: var(--w2-hover); color: var(--text-1); border-color: var(--line-3); }
.w2-taskbar__more.has-attention { color: var(--accent); border-color: color-mix(in srgb, var(--accent), transparent 50%); }
.w2-taskbar__more.has-attention::after { content: ""; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface-solid); }
.w2-taskbar__apps::-webkit-scrollbar { display: none; }
.w2-tb-item { position: relative; display: grid; place-items: center; width: calc(var(--taskbar-h) - 10px); height: calc(var(--taskbar-h) - 10px); border-radius: var(--r-3); flex: none; transition: background-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.w2-tb-item:hover { background: var(--w2-hover); }
.w2-tb-item:active .ui-plate { transform: scale(.9); }
.w2-tb-item .ui-plate { transition: transform var(--dur-fast) var(--ease-spring), filter var(--dur-fast); }
.w2-tb-item:not(.is-running) .ui-plate { filter: saturate(.8); }
.w2-tb-item.is-active { background: var(--w2-press); }
.w2-tb-item__ind { position: absolute; left: 50%; bottom: 2px; height: 3px; width: 0; border-radius: 99px; transform: translateX(-50%); background: var(--text-3); transition: width var(--dur-base) var(--ease-out), background-color var(--dur-base); }
.w2-tb-item.is-running .w2-tb-item__ind { width: 5px; }
.w2-tb-item.is-running[data-count="2"] .w2-tb-item__ind { width: 5px; box-shadow: 7px 0 0 var(--text-3), -7px 0 0 transparent; transform: translateX(-80%); }
.w2-tb-item.is-running[data-count="3"] .w2-tb-item__ind { width: 5px; box-shadow: 7px 0 0 var(--text-3), -7px 0 0 var(--text-3); }
.w2-tb-item.is-active .w2-tb-item__ind { width: 18px; background: var(--accent); box-shadow: 0 0 8px var(--accent-ring) !important; transform: translateX(-50%) !important; }
.w2-tb-item__badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; font-weight: var(--fw-bold); color: var(--text-on-accent); background: var(--accent); box-shadow: 0 0 0 2px var(--surface-solid); font-variant-numeric: tabular-nums; }
.w2-tb-item.is-flashing { animation: w2-tb-flash 1s var(--ease-inout) infinite; }
@keyframes w2-tb-flash { 50% { background: color-mix(in srgb, var(--accent), transparent 70%); } }
.w2-tray { display: flex; align-items: center; gap: 2px; flex: none; }
.w2-tray > button { display: grid; place-items: center; height: calc(var(--taskbar-h) - 14px); min-width: 34px; padding: 0 6px; border-radius: var(--r-3); color: var(--text-2); transition: background-color var(--dur-fast), color var(--dur-fast); }
.w2-tray > button:hover, .w2-tray > button.is-open { background: var(--w2-hover); color: var(--text-1); }
.w2-tray__offline { display: grid; place-items: center; width: 26px; color: var(--warn); animation: w2-breathe 2s var(--ease-inout) infinite; }
.w2-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-4); box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-4), transparent 75%); transition: background-color var(--dur-slow), box-shadow var(--dur-slow); }
.w2-tray__status[data-status="green"] .w2-status-dot { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-bg), 0 0 10px var(--ok); }
.w2-tray__status[data-status="amber"] .w2-status-dot { background: var(--warn); box-shadow: 0 0 0 2px var(--warn-bg), 0 0 10px var(--warn); }
.w2-tray__status[data-status="red"] .w2-status-dot { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg), 0 0 12px var(--danger); animation: w2-breathe 1.6s var(--ease-inout) infinite; }
.w2-tray__bell { position: relative; }
.w2-tray__bell.has-unread .ui-icon { animation: w2-ring 1.2s var(--ease-out) 1; transform-origin: 50% 10%; }
@keyframes w2-ring { 10%, 30% { transform: rotate(12deg); } 20%, 40% { transform: rotate(-10deg); } 50% { transform: none; } }
.w2-tray__count { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; font-size: 9.5px; font-weight: var(--fw-bold); color: var(--text-on-accent); background: var(--accent); box-shadow: 0 0 0 2px var(--surface-solid); font-variant-numeric: tabular-nums; }
.w2-tray__clock { display: flex !important; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; padding: 0 10px !important; line-height: 1.1; font-variant-numeric: tabular-nums; }
.w2-tray__time { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-1); }
.w2-tray__date { font-size: var(--fs-2xs); color: var(--text-3); }
.w2-tray__avatar { padding: 0 4px !important; }
.w2-healthtip { display: flex; flex-direction: column; gap: 3px; }
.w2-healthtip__head { font-weight: var(--fw-semibold); margin-bottom: 2px; }
.w2-healthtip__row { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.w2-healthtip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); flex: none; }
.w2-healthtip__row.is-green .w2-healthtip__dot { background: var(--ok); }
.w2-healthtip__row.is-amber .w2-healthtip__dot { background: var(--warn); }
.w2-healthtip__row.is-red .w2-healthtip__dot { background: var(--danger); }
.w2-healthtip__detail { color: var(--text-3); }

/* ── glass panels shared look ────────────────────────────────────────────────────────────── */
.w2-start, .w2-palette, .w2-centre, .w2-flyout, .w2-preview, .w2-toast, .w2-switch__panel {
  background: var(--surface-2); border: 1px solid var(--line-2);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--shadow-3), 0 30px 80px rgba(0, 0, 0, .3), inset 0 1px 0 var(--w2-highlight);
}

/* ── hover previews ──────────────────────────────────────────────────────────────────────── */
.w2-preview { position: fixed; z-index: var(--z-flyout); display: flex; gap: 8px; padding: 8px; border-radius: var(--r-4); max-width: calc(100vw - 16px); overflow-x: auto; opacity: 0; transform: translateY(6px); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.w2-preview.is-open { opacity: 1; transform: none; }
.w2-preview__card { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: var(--r-3); cursor: pointer; border: 1px solid transparent; transition: background-color var(--dur-fast), border-color var(--dur-fast); flex: none; }
.w2-preview__card:hover, .w2-preview__card:focus-visible { background: var(--w2-hover); border-color: var(--line-2); }
.w2-preview__card.is-focused { border-color: color-mix(in srgb, var(--accent), transparent 55%); }
.w2-preview__card.is-min .w2-preview__thumb { opacity: .55; }
.w2-preview__head { display: flex; align-items: center; gap: 6px; max-width: 224px; }
.w2-preview__title { flex: 1; min-width: 0; font-size: var(--fs-xs); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-preview__close { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: var(--text-3); opacity: 0; transition: opacity var(--dur-fast); }
.w2-preview__card:hover .w2-preview__close, .w2-preview__card:focus-within .w2-preview__close { opacity: 1; }
.w2-preview__close:hover { background: var(--danger); color: #fff; }
.w2-preview__thumb { position: relative; overflow: hidden; border-radius: 6px; background: var(--surface-content); border: 1px solid var(--line-1); min-width: 120px; }
.w2-preview__thumb--frame, .w2-switch__thumb--frame { background: repeating-linear-gradient(135deg, var(--surface-sunken) 0 1px, transparent 1px 7px), var(--surface-solid); }
.w2-preview__thumb--frame { width: 224px; height: 138px; }
.w2-preview__thumb--frame > .w2-preview__clone, .w2-switch__thumb--frame > .w2-preview__clone { box-shadow: 0 0 0 1px var(--line-2), 0 6px 18px rgba(0, 0, 0, .25); border-radius: 2px; }
.w2-preview__thumb--plate, .w2-switch__thumb--plate { display: grid; place-items: center; width: 224px; height: 138px; }
.w2-preview__clone { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: hidden; }
.w2-preview__ph { width: 100%; min-height: 40px; height: 100%; background: repeating-linear-gradient(45deg, var(--surface-sunken) 0 6px, transparent 6px 12px); }
.w2-preview__solo { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; max-width: 260px; }
.w2-preview__solotitle { font-weight: var(--fw-semibold); }
.w2-preview__solodesc { font-size: var(--fs-xs); color: var(--text-3); }

/* ── start menu ──────────────────────────────────────────────────────────────────────────── */
.w2-start-scrim { position: fixed; inset: 0; z-index: var(--z-startmenu); }
.w2-start {
  position: absolute; left: 8px; bottom: calc(var(--taskbar-h) + 16px);
  display: flex; flex-direction: column; width: min(780px, calc(100vw - 16px)); height: min(640px, calc(100vh - var(--taskbar-h) - 32px));
  border-radius: var(--r-6); overflow: hidden; transform-origin: 30px 100%;
  opacity: 0; transform: translateY(20px) scale(.97);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-slow) var(--ease-spring);
}
.w2-start-scrim.is-open .w2-start { opacity: 1; transform: none; }
.w2-start-scrim.is-leaving .w2-start { opacity: 0; transform: translateY(12px) scale(.98); transition: opacity var(--dur-fast) var(--ease-in), transform var(--dur-fast) var(--ease-in); }
.w2-start__search { position: relative; display: flex; align-items: center; gap: 10px; margin: 18px 18px 6px; height: 42px; padding: 0 12px; border-radius: var(--r-4); background: var(--surface-sunken); border: 1px solid var(--line-2); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.w2-start__search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.w2-start__glyph { color: var(--text-3); }
.w2-start__input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; font-size: var(--fs-lg); color: var(--text-1); }
.w2-start__input::placeholder { color: var(--text-3); }
.w2-start__input::-webkit-search-cancel-button { display: none; }
.w2-start__home { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 4px; flex: 1; min-height: 0; padding: 6px 10px 6px 18px; }
.w2-start__left, .w2-start__right { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding: 6px 8px 10px 0; }
.w2-start__right { border-left: 1px solid var(--line-1); padding-left: 14px; }
.w2-start__section { display: flex; flex-direction: column; gap: 8px; }
.w2-start__tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.w2-start__tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 2px 8px; border-radius: var(--r-3); transition: background-color var(--dur-fast); }
.w2-start__tile:hover, .w2-start__tile:focus-visible { background: var(--w2-hover); }
.w2-start__tile .ui-plate { transition: transform var(--dur-fast) var(--ease-spring); }
.w2-start__tile:hover .ui-plate { transform: translateY(-2px) scale(1.04); }
.w2-start__tilelabel { font-size: var(--fs-xs); color: var(--text-1); text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-start__all { display: flex; flex-direction: column; gap: 12px; }
.w2-start__cat { display: flex; flex-direction: column; gap: 4px; }
.w2-start__catlabel { padding-left: 6px; }
.w2-start__apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.w2-start__app { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-3); text-align: left; min-width: 0; transition: background-color var(--dur-fast); }
.w2-start__app:hover, .w2-start__app:focus-visible { background: var(--w2-hover); }
.w2-start__apptext { display: flex; flex-direction: column; min-width: 0; }
.w2-start__apptitle { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-1); }
.w2-start__appdesc { font-size: var(--fs-2xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-start__upnext, .w2-start__recentlist { display: flex; flex-direction: column; gap: 4px; }
/* round 1: the Up next header carries the session-briefing link; the Tasks line sits under the dated clocks */
.w2-start__sechead { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.w2-start__seclink { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px 0 8px; border-radius: 99px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .02em; color: var(--accent); background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent), transparent 70%); transition: background-color var(--dur-fast), border-color var(--dur-fast); }
.w2-start__seclink:hover { background: color-mix(in srgb, var(--accent-weak), var(--accent) 14%); border-color: color-mix(in srgb, var(--accent), transparent 45%); }
.w2-start__seclink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.w2-start__due { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-3); text-align: left; background: var(--surface-sunken); border: 1px solid var(--line-1); transition: border-color var(--dur-fast), background-color var(--dur-fast); }
.w2-start__due:hover { border-color: var(--line-3); }
.w2-start__duedays { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; flex: none; background: var(--accent-weak); color: var(--accent); line-height: 1; }
.w2-start__due.is-soon .w2-start__duedays { background: var(--warn-bg); color: var(--warn); }
.w2-start__due.is-urgent .w2-start__duedays { background: color-mix(in srgb, var(--flag-urgent), transparent 82%); color: var(--flag-urgent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--flag-urgent), transparent 60%); }
.w2-start__due.is-expired .w2-start__duedays { background: var(--danger-bg); color: var(--danger); }
.w2-start__duenum { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.w2-start__dueunit { font-size: 9px; font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; margin-top: 1px; }
.w2-start__duetext { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.w2-start__duename { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-1); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w2-start__duedate { font-size: var(--fs-2xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.w2-start__recent { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-3); text-align: left; min-width: 0; transition: background-color var(--dur-fast); }
.w2-start__recent:hover, .w2-start__recent:focus-visible { background: var(--w2-hover); }
.w2-start__recenticon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-sunken); color: var(--text-2); flex: none; }
.w2-start__recenttext { display: flex; flex-direction: column; min-width: 0; }
.w2-start__recenttitle { font-size: var(--fs-sm); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-start__recentmeta { font-size: var(--fs-2xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-start__none { font-size: var(--fs-sm); color: var(--text-3); padding: 4px 8px; line-height: 1.5; }
.w2-start__results { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 10px; }
.w2-start__noresults { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 40px; color: var(--text-3); }
.w2-start__foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-1); background: linear-gradient(180deg, transparent, var(--surface-sunken)); }
.w2-start__user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.w2-start__usertext { display: flex; flex-direction: column; min-width: 0; }
.w2-start__username { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-start__userrole { font-size: var(--fs-2xs); color: var(--text-3); text-transform: capitalize; }
.w2-start__footbtns { display: flex; gap: 2px; }

/* ── results list (start + palette) ──────────────────────────────────────────────────────── */
.w2-results { display: flex; flex-direction: column; gap: 1px; }
.w2-results__group { display: flex; align-items: center; gap: 6px; padding: 10px 10px 4px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-3); }
.w2-results__group:first-child { padding-top: 4px; }
.w2-results__item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 5px 10px; border-radius: var(--r-3); cursor: pointer; }
.w2-results__item.is-selected { background: var(--accent-weak); }
.w2-results__icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-sunken); color: var(--text-2); flex: none; }
.w2-results__item.is-selected .w2-results__icon { color: var(--accent); }
.w2-results__text { flex: 1; min-width: 0; }
.w2-results__title { font-size: var(--fs-md); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-results__sub { font-size: var(--fs-2xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-results__enter { color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity var(--dur-fast), transform var(--dur-fast); }
.w2-results__item.is-selected .w2-results__enter { opacity: 1; transform: none; }
.w2-results__item .ui-kbd { opacity: .75; }

/* ── command palette ─────────────────────────────────────────────────────────────────────── */
.w2-palette-scrim { position: fixed; inset: 0; z-index: var(--z-palette); display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh; background: transparent; transition: background-color var(--dur-base); }
.w2-palette-scrim.is-open { background: color-mix(in srgb, var(--scrim), transparent 55%); }
.w2-palette { display: flex; flex-direction: column; width: min(640px, calc(100vw - 32px)); max-height: 64vh; border-radius: var(--r-5); overflow: hidden; opacity: 0; transform: translateY(-8px) scale(.985); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.w2-palette-scrim.is-open .w2-palette { opacity: 1; transform: none; }
.w2-palette__row { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--line-1); flex: none; }
.w2-palette__glyph { color: var(--accent); }
.w2-palette__input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; font-size: var(--fs-lg); color: var(--text-1); }
.w2-palette__input::placeholder { color: var(--text-3); }
.w2-palette > .w2-results { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px; }
.w2-palette__empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--text-3); }
.w2-palette__foot { display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line-1); font-size: var(--fs-2xs); color: var(--text-3); flex: none; background: var(--surface-sunken); }
.w2-palette__foot > span { display: inline-flex; align-items: center; gap: 4px; }
.w2-palette__foot-r { margin-left: auto; }

/* ── window switcher ─────────────────────────────────────────────────────────────────────── */
.w2-switch { position: fixed; inset: 0; z-index: var(--z-palette); display: grid; place-items: center; pointer-events: auto; background: color-mix(in srgb, var(--scrim), transparent 50%); opacity: 0; transition: opacity var(--dur-fast); }
.w2-switch.is-open { opacity: 1; }
.w2-switch__panel { max-width: calc(100vw - 48px); padding: 18px; border-radius: var(--r-6); }
.w2-switch__cards { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.w2-switch__card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: var(--r-4); border: 2px solid transparent; cursor: pointer; transition: border-color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.w2-switch__card.is-selected { border-color: var(--accent); background: var(--accent-weak); transform: translateY(-2px); }
.w2-switch__thumb { position: relative; overflow: hidden; border-radius: 8px; background: var(--surface-content); border: 1px solid var(--line-1); min-width: 120px; }
.w2-switch__thumb--plate, .w2-switch__thumb--frame { width: 200px; height: 124px; }
.w2-switch__meta { margin-left: auto; font-size: var(--fs-2xs); color: var(--text-3); flex: none; }
.w2-switch__card.is-min .w2-switch__thumb { opacity: .55; }
.w2-switch__label { display: flex; align-items: center; gap: 6px; width: 200px; font-size: var(--fs-sm); }
.w2-switch__label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-switch__hint { margin-top: 12px; text-align: center; font-size: var(--fs-2xs); color: var(--text-3); letter-spacing: .04em; }

/* ── toasts ──────────────────────────────────────────────────────────────────────────────── */
.w2-toasts { position: fixed; right: 16px; bottom: calc(var(--taskbar-h) + 22px); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out); }
/* a tray flyout (calendar) is open: the toasts step aside instead of covering it */
.w2-has-flyout .w2-toasts { opacity: 0; transform: translateX(24px); pointer-events: none; }
.w2-has-flyout .w2-toasts .w2-toast { pointer-events: none; }
.w2-toast { --tc: var(--info); position: relative; display: flex; align-items: flex-start; gap: 10px; width: 360px; max-width: calc(100vw - 32px); padding: 12px 10px 12px 14px; border-radius: var(--r-4); overflow: hidden; pointer-events: auto; opacity: 0; transform: translateX(28px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.w2-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc); }
.w2-toast.is-in { opacity: 1; transform: none; }
.w2-toast.is-leaving { opacity: 0; transform: translateX(28px); transition-duration: var(--dur-fast); }
.w2-toast--success { --tc: var(--ok); } .w2-toast--warn { --tc: var(--warn); } .w2-toast--error { --tc: var(--danger); }
.w2-toast__icon { color: var(--tc); margin-top: 1px; flex: none; }
.w2-toast__content { flex: 1; min-width: 0; }
.w2-toast__title { font-weight: var(--fw-semibold); font-size: var(--fs-md); overflow-wrap: anywhere; }
.w2-toast__body { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.w2-toast__actions { margin-top: 8px; display: flex; gap: 6px; }
.w2-toast__close { margin: -4px -2px 0 0; }
.w2-toast__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--tc); opacity: .5; transform-origin: left; animation: w2-toast-t linear forwards; }
@keyframes w2-toast-t { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── notification centre ─────────────────────────────────────────────────────────────────── */
.w2-centre { position: fixed; top: 8px; right: 8px; bottom: calc(var(--taskbar-h) + 16px); z-index: var(--z-flyout); display: flex; flex-direction: column; width: min(380px, calc(100vw - 16px)); border-radius: var(--r-5); overflow: hidden; opacity: 0; transform: translateX(24px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.w2-centre.is-open { opacity: 1; transform: none; }
.w2-centre__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 16px; }
.w2-centre__heading { display: flex; flex-direction: column; gap: 2px; }
.w2-centre__count { font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
.w2-centre__bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 10px 16px; border-bottom: 1px solid var(--line-1); }
.w2-centre__list { flex: 1; overflow-y: auto; padding: 6px 8px 12px; }
.w2-centre__group { padding: 10px 8px 4px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-3); }
.w2-centre__item { --tc: var(--info); position: relative; display: flex; gap: 10px; padding: 10px 8px 10px 12px; margin-bottom: 4px; border-radius: var(--r-3); background: var(--surface-sunken); border: 1px solid var(--line-1); }
.w2-centre__item.is-unread { border-color: color-mix(in srgb, var(--tc), transparent 60%); }
.w2-centre__item.is-unread::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tc); box-shadow: 0 0 8px color-mix(in srgb, var(--tc), transparent 50%); }
.w2-centre__item--success { --tc: var(--ok); } .w2-centre__item--warn { --tc: var(--warn); } .w2-centre__item--error { --tc: var(--danger); }
.w2-centre__icon { color: var(--tc); flex: none; margin-top: 1px; }
.w2-centre__content { flex: 1; min-width: 0; }
.w2-centre__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.w2-centre__body { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; line-height: 1.45; }
.w2-centre__meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: var(--fs-2xs); color: var(--text-3); }
.w2-centre__action { color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-2xs); }
.w2-centre__action:hover { text-decoration: underline; }
.w2-centre__remove { opacity: 0; transition: opacity var(--dur-fast); }
.w2-centre__item:hover .w2-centre__remove, .w2-centre__remove:focus-visible { opacity: 1; }

/* ── calendar flyout ─────────────────────────────────────────────────────────────────────── */
.w2-flyout { position: fixed; z-index: var(--z-flyout); border-radius: var(--r-5); opacity: 0; transform: translateY(8px); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.w2-flyout.is-open { opacity: 1; transform: none; }
.w2-cal { width: 320px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.w2-cal__head { padding-bottom: 12px; border-bottom: 1px solid var(--line-1); }
.w2-cal__time { font-family: var(--font-display); font-size: var(--fs-4xl); font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.w2-cal__date { margin-top: 6px; font-family: var(--font-serif); font-style: italic; color: var(--accent); font-size: var(--fs-lg); }
.w2-cal__nav { display: flex; align-items: center; justify-content: space-between; }
.w2-cal__month { font-weight: var(--fw-semibold); }
.w2-cal__navbtns { display: flex; align-items: center; gap: 2px; }
.w2-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.w2-cal__dow { text-align: center; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text-3); padding: 4px 0; }
.w2-cal__day { position: relative; display: grid; place-items: center; height: 34px; border-radius: 8px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text-1); }
.w2-cal__day.is-weekend { color: var(--text-2); }
.w2-cal__day.is-out { color: var(--text-4); }
.w2-cal__day.is-today { background: var(--accent); color: var(--text-on-accent); font-weight: var(--fw-bold); box-shadow: 0 4px 14px -6px var(--accent); }
.w2-cal__day.has-due:not(.is-today) { background: var(--accent-weak); }
.w2-cal__dot { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.w2-cal__day.is-urgent .w2-cal__dot { background: var(--flag-urgent); box-shadow: 0 0 6px var(--flag-urgent); }
.w2-cal__day.is-today .w2-cal__dot { background: var(--text-on-accent); }
.w2-cal__agenda { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-1); }
.w2-cal__item { display: flex; align-items: center; gap: 10px; }
/* round-5 integration: a next date is one click from its clock (by its stable id) */
.w2-cal__item.is-link { width: 100%; margin: 0 -6px; padding: 4px 6px; border: 0; border-radius: var(--r-2); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur-fast); }
.w2-cal__item.is-link:hover { background: var(--w2-hover); }
.w2-cal__item.is-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.w2-cal__itemdays { min-width: 58px; padding: 3px 0; border-radius: 6px; text-align: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; background: var(--accent-weak); color: var(--accent); }
.w2-cal__item.is-urgent .w2-cal__itemdays { background: color-mix(in srgb, var(--flag-urgent), transparent 82%); color: var(--flag-urgent); }
.w2-cal__item.is-expired .w2-cal__itemdays { background: var(--danger-bg); color: var(--danger); }
.w2-cal__itemtext { display: flex; flex-direction: column; min-width: 0; }
.w2-cal__itemname { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-cal__itemdate { font-size: var(--fs-2xs); color: var(--text-3); }
.w2-cal__none { font-size: var(--fs-sm); color: var(--text-3); }
.w2-cal__foot { display: flex; justify-content: flex-end; }

/* ── auth: login, first run, standby ─────────────────────────────────────────────────────── */
.w2-auth { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: auto; }
.w2-auth > .w2-wallpaper { position: fixed; }
.w2-auth__stage { position: relative; z-index: 2; flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.w2-auth__card {
  width: min(380px, 100%); padding: 34px 32px 30px; border-radius: var(--r-6);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: color-mix(in srgb, var(--surface-1), transparent 12%); border: 1px solid var(--line-2);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .03), inset 0 1px 0 var(--w2-highlight);
  opacity: 0; transform: translateY(14px) scale(.985); transition: opacity var(--dur-deliberate) var(--ease-out), transform var(--dur-deliberate) var(--ease-out);
}
.w2-auth.is-in .w2-auth__card { opacity: 1; transform: none; }
.w2-auth__card.is-leaving { opacity: 0 !important; transform: scale(.98) !important; transition-duration: var(--dur-fast) !important; }
.w2-auth__card.is-shake { animation: w2-shake .45s var(--ease-inout); }
.w2-auth__card--wide { width: min(460px, 100%); }
.w2-auth__seal { width: 76px; height: 76px; filter: drop-shadow(0 10px 28px rgba(212, 169, 79, .35)); margin-bottom: 14px; }
.w2-auth__eyebrow { color: color-mix(in srgb, var(--accent), var(--text-3) 30%); }
.w2-auth__title { margin-top: 6px; font-family: var(--font-serif); font-size: var(--fs-3xl); font-weight: var(--fw-regular); letter-spacing: .01em; color: var(--text-1); }
.w2-auth__lede { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.5; max-width: 34ch; text-wrap: balance; }
.w2-auth__card--wide .w2-auth__lede { max-width: 40ch; }
.w2-auth__form { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 22px; text-align: left; }
.w2-auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w2-auth__field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.w2-auth__label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); }
.w2-auth__input { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-3); background: var(--surface-sunken); border: 1px solid var(--line-2); color: var(--text-1); font-size: var(--fs-md); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.w2-auth__input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.w2-auth__input--code { font-family: var(--font-mono); letter-spacing: .18em; text-transform: uppercase; text-align: center; font-size: var(--fs-lg); }
.w2-auth__hint { font-size: var(--fs-2xs); color: var(--text-3); line-height: 1.4; }
.w2-auth__hint--row { grid-column: 1 / -1; margin-top: -5px; }
.w2-auth__card--wide .w2-auth__seal { width: 64px; height: 64px; margin-bottom: 10px; }
@media (max-height: 760px) {
  .w2-auth__stage { padding: 16px; }
  .w2-auth__card { padding: 24px 28px 22px; }
  .w2-auth__seal, .w2-auth__card--wide .w2-auth__seal { width: 52px; height: 52px; margin-bottom: 8px; }
  .w2-auth__title { font-size: var(--fs-2xl); }
  .w2-auth__form { gap: 9px; margin-top: 16px; }
  .w2-auth__input { height: 36px; }
  .w2-auth__foot { padding: 8px; }
}
.w2-auth__error { padding: 8px 10px; border-radius: var(--r-2); background: var(--danger-bg); color: var(--danger); font-size: var(--fs-sm); border: 1px solid color-mix(in srgb, var(--danger), transparent 70%); }
.w2-auth__error--info { background: var(--info-bg); color: var(--text-1); border-color: color-mix(in srgb, var(--info), transparent 70%); }
.w2-auth__submit { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin-top: 4px; border-radius: var(--r-3); font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-on-accent); background: linear-gradient(180deg, var(--accent-strong), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -10px var(--accent); transition: filter var(--dur-fast), transform var(--dur-instant); width: 100%; }
.w2-auth__card > .w2-auth__submit { margin-top: 22px; }
.w2-auth__submit:hover:not(:disabled) { filter: brightness(1.06); }
.w2-auth__submit:active:not(:disabled) { transform: translateY(1px); }
.w2-auth__submit:disabled { opacity: .6; }
.w2-auth__submit.is-busy > * { opacity: 0; }
.w2-auth__submit.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .2); border-top-color: var(--text-on-accent); animation: w2-spin .8s linear infinite; }
.w2-auth__foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px; font-size: var(--fs-2xs); letter-spacing: .04em; color: var(--text-3); text-shadow: var(--w2-desk-shadow); }
.w2-pwdlg { display: flex; flex-direction: column; gap: 12px; }
.w2-pwdlg__lede { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.w2-pwdlg .w2-auth__input { height: 36px; }

/* ── lock screen ─────────────────────────────────────────────────────────────────────────── */
.w2-lock { position: absolute; inset: 0; z-index: var(--z-lock); display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 44px; padding: 24px 24px 56px; overflow-y: auto; background: radial-gradient(ellipse at 50% 30%, transparent 30%, color-mix(in srgb, var(--bg-0), transparent 40%) 100%); opacity: 0; transition: opacity var(--dur-deliberate) var(--ease-out); }
.w2-lock.is-in { opacity: 1; }
.w2-lock.is-leaving { opacity: 0; transition-duration: var(--dur-slow); }
.w2-lock__clock { text-align: center; color: var(--w2-desk-text); text-shadow: var(--w2-desk-shadow); transform: translateY(-10px); transition: transform var(--dur-deliberate) var(--ease-out); }
.w2-lock.is-in .w2-lock__clock { transform: none; }
.w2-lock__time { font-family: var(--font-serif); font-size: var(--fs-5xl); font-weight: var(--fw-regular); line-height: 1; letter-spacing: .01em; font-variant-numeric: lining-nums tabular-nums; }
.w2-lock__date { margin-top: 10px; font-family: var(--font-serif); font-style: italic; font-size: var(--fs-xl); color: color-mix(in srgb, var(--w2-desk-text), var(--accent) 30%); }
.w2-lock__card { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(340px, 100%); padding: 26px 26px 18px; border-radius: var(--r-6); background: color-mix(in srgb, var(--surface-1), transparent 10%); border: 1px solid var(--line-2); backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); box-shadow: 0 40px 100px rgba(0, 0, 0, .45), inset 0 1px 0 var(--w2-highlight); }
.w2-lock__card.is-shake { animation: w2-shake .45s var(--ease-inout); }
:root[data-theme="light"] .w2-lock__card, :root[data-theme="light"] .w2-auth__card { box-shadow: 0 30px 80px rgba(70, 50, 15, .16), 0 2px 6px rgba(70, 50, 15, .08), inset 0 1px 0 var(--w2-highlight); }
.w2-lock__card .ui-avatar { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 4px var(--accent-ring), 0 10px 26px -8px var(--accent); }
.w2-lock__name { margin-top: 4px; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.w2-lock__state { color: color-mix(in srgb, var(--accent), var(--text-3) 30%); }
.w2-lock__form { width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.w2-lock__field { position: relative; display: flex; align-items: center; height: 42px; border-radius: var(--r-pill); background: var(--surface-sunken); border: 1px solid var(--line-2); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.w2-lock__field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.w2-lock__fieldicon { position: absolute; left: 14px; color: var(--text-3); }
.w2-lock__input { flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 38px; background: transparent; border: 0; color: var(--text-1); font-size: var(--fs-md); }
.w2-lock__input::placeholder, .w2-auth__input::placeholder { color: var(--text-3); }
.w2-lock__go { display: grid; place-items: center; width: 34px; height: 34px; margin-right: 3px; border-radius: 50%; color: var(--text-on-accent); background: linear-gradient(180deg, var(--accent-strong), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); transition: transform var(--dur-fast) var(--ease-spring); }
.w2-lock__go:hover:not(:disabled) { transform: translateX(2px); }
.w2-lock__error { text-align: center; color: var(--danger); font-size: var(--fs-sm); }
.w2-lock__signout { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.w2-lock__signout:hover { color: var(--text-1); }
.w2-lock__foot { position: fixed; bottom: 18px; left: 0; right: 0; justify-content: center; pointer-events: none; display: flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); letter-spacing: .06em; color: var(--text-3); text-shadow: var(--w2-desk-shadow); }

/* ── file picker, external-link confirm ──────────────────────────────────────────────────── */
.w2-picker__body { display: flex; flex-direction: column; gap: 10px; height: min(520px, 60vh); }
.w2-picker__top { display: flex; align-items: center; gap: 10px; }
.w2-picker__crumbs { flex: 1; min-width: 0; }
.w2-picker__top .ui-search { width: 260px; flex: none; }
.w2-picker__list { flex: 1; min-height: 0; display: flex; border: 1px solid var(--line-1); border-radius: var(--r-3); background: var(--surface-sunken); padding: 4px; }
.w2-picker__row { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; }
.w2-picker__icon { color: var(--text-3); flex: none; }
.w2-picker__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-picker__row.is-locked { color: var(--text-4); }
.w2-picker__row.is-dim { opacity: .5; }
.w2-picker__lock { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-2xs); color: var(--text-3); padding: 1px 6px; border-radius: 99px; border: 1px solid var(--line-2); }
.w2-picker__meta { font-size: var(--fs-2xs); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.w2-picker__foot { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); min-height: 22px; }
.w2-picker__chosen { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: var(--fs-xs); }
.w2-picker__status { font-size: var(--fs-xs); color: var(--text-3); min-width: 120px; text-align: right; }
.w2-extlink p { color: var(--text-2); margin-bottom: 10px; line-height: 1.5; }
.w2-extlink__url { display: block; padding: 8px 10px; border-radius: var(--r-2); background: var(--surface-sunken); border: 1px solid var(--line-1); font-family: var(--font-mono); font-size: var(--fs-xs); overflow-wrap: anywhere; color: var(--info); }

/* short viewports: the lock screen stacks tighter and its footer joins the flow instead of covering the field */
@media (max-height: 620px) {
  .w2-lock { gap: 18px; padding-bottom: 16px; }
  .w2-lock__time { font-size: var(--fs-4xl); }
  .w2-lock__card { padding: 18px 22px 14px; }
  .w2-lock__card .ui-avatar { --avatar-size: 48px !important; }
  .w2-lock__foot { position: static; margin-top: 4px; }
}

/* ── narrow viewports ────────────────────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  .w2-clockw { display: none; }
  .w2-start__home { grid-template-columns: 1fr; }
  .w2-start__right { border-left: 0; padding-left: 0; }
  .w2-start__tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .w2-tray__date { display: none; }
}

/* ══ round 2 (WP-WINDOWS): tab-groups · pairing · always on top · scenes ═════════════════════════════════════════ */

/* ── window tab-groups: the strip replaces the title; hidden tabs sit behind the visible one ── */
.w2-window.is-tabbed-out { visibility: hidden !important; pointer-events: none !important; }
.w2-window.is-grouped > .w2-titlebar > .w2-titlebar__plate,
.w2-window.is-grouped > .w2-titlebar > .w2-titlebar__text,
.w2-window.is-grouped > .w2-titlebar > .w2-titlebar__badge { display: none; }
.w2-window.is-grouped > .w2-titlebar { padding-left: 6px; gap: 6px; }
.w2-titlebar__tabs { position: relative; display: flex; align-items: flex-end; align-self: stretch; gap: 1px; flex: 1 1 auto; min-width: 0; padding-top: 6px; overflow: hidden; }
.w2-titlebar__tabs[hidden] { display: none; }
.w2-gtab {
  position: relative; display: flex; align-items: center; gap: 7px; flex: 0 1 196px; min-width: 64px; height: 100%;
  padding: 0 5px 0 9px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--r-3) var(--r-3) 0 0;
  color: var(--text-3); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: default; user-select: none; touch-action: none;
  transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.w2-gtab::after { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 1px; background: var(--line-2); transition: opacity var(--dur-fast); }
.w2-gtab:first-child::after, .w2-gtab.is-active::after, .w2-gtab.is-active + .w2-gtab::after, .w2-gtab:hover::after, .w2-gtab:hover + .w2-gtab::after { opacity: 0; }
.w2-gtab:hover { background: var(--w2-hover); color: var(--text-1); }
.w2-gtab.is-active {
  z-index: 1; margin-bottom: -1px; height: calc(100% + 1px);
  background: var(--surface-content); border-color: var(--line-2); color: var(--text-1); font-weight: var(--fw-semibold);
}
.w2-gtab.is-active::before { content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent-ring); }
.w2-window:not(.is-focused) .w2-gtab.is-active::before { background: var(--line-3); box-shadow: none; }
.w2-window:not(.is-focused) .w2-gtab.is-active { color: var(--text-2); }
.w2-gtab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.w2-gtab__plate { flex: none; transition: filter var(--dur-fast); }
.w2-gtab:not(.is-active) .w2-gtab__plate { filter: saturate(.45) opacity(.8); }
.w2-gtab__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-gtab__badge { flex: none; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; font-weight: var(--fw-bold); color: var(--text-on-accent); background: var(--accent); font-variant-numeric: tabular-nums; }
.w2-gtab__close { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; color: var(--text-3); opacity: 0; transition: opacity var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast); }
.w2-gtab:hover .w2-gtab__close, .w2-gtab.is-active .w2-gtab__close, .w2-gtab:focus-visible .w2-gtab__close { opacity: 1; }
.w2-gtab__close:hover { background: var(--danger); color: #fff; }
.w2-gtab.is-busy .w2-gtab__plate { animation: w2-breathe calc(var(--dur-deliberate) * 3.5) var(--ease-inout) infinite; }
.w2-gtab.is-dragging { z-index: 3; background: var(--surface-3); border-color: var(--line-3); color: var(--text-1); box-shadow: var(--shadow-2); transition: none; cursor: grabbing; }
.w2-titlebar__tabs.is-sorting .w2-gtab:not(.is-dragging) { pointer-events: none; }
:root[data-density="compact"] .w2-titlebar__tabs { padding-top: 4px; }
:root[data-density="compact"] .w2-gtab { font-size: var(--fs-xs); }

/* dropping a dragged window onto another's title bar groups the two */
.w2-window.is-drop-target { border-color: var(--accent) !important; box-shadow: var(--shadow-window-focus), 0 0 0 2px var(--accent), 0 0 32px var(--accent-ring) !important; }
.w2-window.is-drop-target > .w2-titlebar { background: linear-gradient(180deg, color-mix(in srgb, var(--accent), transparent 70%), color-mix(in srgb, var(--accent), transparent 90%)); }
.w2-window.is-drop-target > .w2-titlebar::before {
  content: "Drop to group as tabs"; position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%);
  padding: 3px 11px; border-radius: var(--r-pill); white-space: nowrap; pointer-events: none;
  background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-2);
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .04em;
  animation: w2-fade-in var(--dur-fast) var(--ease-out);
}
.w2-window.is-dragging.is-grouping { opacity: .92; border-radius: calc(var(--r-window) * 2); box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 0 2px var(--accent); }
@keyframes w2-join { 0% { transform: scale(.985); } 60% { transform: scale(1.004); } 100% { transform: none; } }
.w2-window.is-joined { animation: w2-join var(--dur-deliberate) var(--ease-out); }

/* ── pairing: the link chip in both title bars, the partner hint, the arrival pulse ── */
.w2-tchip {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: 200px; height: 22px; padding: 0 9px 0 7px;
  border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--accent), transparent 60%);
  background: var(--accent-weak); color: var(--accent);
  font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: .02em; white-space: nowrap;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.w2-tchip[hidden] { display: none; }
.w2-tchip:hover, .w2-tchip[aria-expanded="true"] { background: color-mix(in srgb, var(--accent), transparent 74%); border-color: color-mix(in srgb, var(--accent), transparent 30%); }
.w2-tchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.w2-tchip__arrow { font-weight: var(--fw-bold); opacity: .85; }
.w2-tchip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.w2-window:not(.is-focused) .w2-tchip--link { color: var(--text-2); background: var(--surface-sunken); border-color: var(--line-2); }
.w2-tchip--pin { width: 24px; padding: 0; justify-content: center; border-color: transparent; background: transparent; color: var(--accent); }
.w2-tchip--pin:hover { background: var(--w2-hover); border-color: transparent; }
.w2-window:not(.is-focused) .w2-tchip--pin { color: var(--text-3); }
.w2-window.is-pair-hint { box-shadow: var(--shadow-window), 0 0 0 2px var(--accent), 0 0 28px var(--accent-ring) !important; }
.w2-window.is-pair-hint .w2-tchip--link { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
@keyframes w2-pair-ring { 0% { box-shadow: var(--shadow-window), 0 0 0 0 var(--accent-ring); } 30% { box-shadow: var(--shadow-window), 0 0 0 4px var(--accent-ring); } 100% { box-shadow: var(--shadow-window), 0 0 0 10px transparent; } }
@keyframes w2-chip-ping { 25% { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 0 0 4px var(--accent-weak); } }
.w2-window.is-pair-arrive, .w2-window.is-linked, .w2-window.is-drag-raised { animation: w2-pair-ring calc(var(--dur-deliberate) * 2) var(--ease-out); }
.w2-window.is-pair-arrive .w2-tchip--link, .w2-window.is-linked .w2-tchip--link { animation: w2-chip-ping calc(var(--dur-deliberate) * 2) var(--ease-out); }

/* ── always on top ── */
.w2-window.is-ontop { border-top-color: color-mix(in srgb, var(--accent), transparent 35%); }

/* ── the taskbar's scenes button ── */
.w2-taskbar__scenes { display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-left: 2px; border-radius: var(--r-3); color: var(--text-2); transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-spring); }
.w2-taskbar__scenes:hover { background: var(--w2-hover); color: var(--text-1); }
.w2-taskbar__scenes:active { transform: scale(.93); }
.w2-taskbar__scenes.is-open { background: var(--accent-weak); color: var(--accent); }

/* ── the scenes popover ── */
.w2-scenes {
  position: fixed; z-index: var(--z-flyout); display: flex; flex-direction: column;
  max-height: calc(100vh - var(--taskbar-h) - 40px); border-radius: var(--r-5); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line-2);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--shadow-3), 0 30px 80px rgba(0, 0, 0, .3), inset 0 1px 0 var(--w2-highlight);
  opacity: 0; transform: translateY(10px) scale(.985); transform-origin: 40px 100%;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.w2-scenes.is-open { opacity: 1; transform: none; }
.w2-scenes::before { content: ""; position: absolute; left: 28px; right: 28px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent), transparent 40%), transparent); pointer-events: none; }
.w2-scenes__head { display: flex; align-items: center; gap: 12px; flex: none; padding: 14px 16px 12px; border-bottom: 1px solid var(--line-1); }
.w2-scenes__titles { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.w2-scenes__eyebrow { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--accent); }
.w2-scenes__sub { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-scenes__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px 16px; }
.w2-scenes__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.w2-scenes__foot { display: flex; align-items: center; gap: 7px; flex: none; padding: 9px 16px; border-top: 1px solid var(--line-1); background: var(--surface-sunken); font-size: var(--fs-2xs); color: var(--text-3); }
.w2-scenes__foot .ui-icon { flex: none; }
.w2-scenes__state { display: flex; align-items: center; gap: 10px; padding: 12px 4px; color: var(--text-2); font-size: var(--fs-sm); }
.w2-scenes__state--error > .ui-icon { color: var(--danger); }
.w2-scenes__state .ui-btn { margin-left: auto; }
.w2-scenes__intro { display: flex; align-items: flex-start; gap: 14px; padding: 2px 2px 16px; }
.w2-scenes__introicon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--r-4); color: var(--accent); background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent), transparent 60%); }
.w2-scenes__introtitle { margin: 2px 0 4px; font-family: var(--font-serif); font-size: var(--fs-xl); line-height: var(--lh-tight); color: var(--text-1); }
.w2-scenes__introbody { margin: 0; max-width: 62ch; font-size: var(--fs-sm); line-height: var(--lh-ui); color: var(--text-2); }
.w2-scenes__label { margin: 0 2px 9px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-3); }

.w2-scene { position: relative; min-width: 0; }
.w2-scene__main {
  display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 8px 8px 10px; text-align: left;
  border-radius: var(--r-4); border: 1px solid var(--line-1); background: var(--surface-sunken); color: inherit;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.w2-scene__main:hover { background: var(--w2-hover); border-color: var(--line-3); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.w2-scene__main:active { transform: translateY(0) scale(.99); }
.w2-scene__main:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.w2-scene.is-default .w2-scene__main { border-color: color-mix(in srgb, var(--accent), transparent 55%); }
.w2-scene__thumb { position: relative; display: block; flex: none; width: 164px; height: 94px; margin: 0 auto; }
.w2-scene__frame {
  position: absolute; border-radius: 5px; border: 1px solid var(--line-2);
  background: radial-gradient(120% 90% at 10% 0%, color-mix(in srgb, var(--chart-1), transparent 82%), transparent 60%),
              radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--chart-2), transparent 84%), transparent 60%), var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--w2-highlight);
}
.w2-scene__win {
  --c: var(--chart-3); position: absolute; display: grid; place-items: center; overflow: hidden; border-radius: 3px;
  background: color-mix(in srgb, var(--c), var(--surface-solid) 76%); border: 1px solid color-mix(in srgb, var(--c), transparent 35%);
  box-shadow: var(--shadow-1); transition: transform var(--dur-base) var(--ease-out);
}
.w2-scene__win::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: color-mix(in srgb, var(--c), transparent 40%); }
.w2-scene__win[data-cat="case"] { --c: var(--chart-1); }
.w2-scene__win[data-cat="status"] { --c: var(--chart-2); }
.w2-scene__win[data-cat="tools"] { --c: var(--chart-3); }
.w2-scene__win[data-cat="system"] { --c: var(--chart-6); }
.w2-scene__win.is-missing { --c: var(--text-4); background: repeating-linear-gradient(45deg, var(--surface-sunken) 0 3px, transparent 3px 7px), var(--surface-solid); }
.w2-scene__win.is-ontop { box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.w2-scene__main:hover .w2-scene__win { transform: translateY(-.5px); }
.w2-scene__plate { margin-top: 2px; box-shadow: none; }
.w2-scene__tabs { position: absolute; top: 6px; right: 3px; min-width: 13px; height: 13px; padding: 0 3px; border-radius: 99px; display: grid; place-items: center; font-size: 8.5px; font-weight: var(--fw-bold); background: var(--c); color: var(--text-on-accent); }
.w2-scene__links { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.w2-scene__links line { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 2.5 2.5; stroke-linecap: round; }
.w2-scene__links circle { fill: var(--accent); stroke: var(--surface-solid); stroke-width: 1; }
.w2-scene__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 3px; }
.w2-scene__name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-1); }
.w2-scene__nametext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w2-scene__star { flex: none; color: var(--accent); }
.w2-scene__meta { font-size: var(--fs-xs); line-height: 1.35; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w2-scene__actions {
  position: absolute; top: 12px; right: 12px; display: flex; gap: 1px; padding: 2px; border-radius: var(--r-3);
  background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(-3px); pointer-events: none;
  transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.w2-scene:hover .w2-scene__actions, .w2-scene:has(:focus-visible) .w2-scene__actions { opacity: 1; transform: none; pointer-events: auto; }
.w2-scene.is-default .w2-scene__default { color: var(--accent); }
.w2-scene__delete:hover:not(:disabled) { color: var(--danger); background: var(--danger-bg); }
.w2-scene.is-skeleton { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border-radius: var(--r-4); border: 1px solid var(--line-1); background: var(--surface-sunken); }
.w2-scene.is-skeleton .w2-scene__thumb, .w2-scene.is-skeleton .w2-scene__lines > span {
  border-radius: 5px; background: linear-gradient(90deg, var(--surface-sunken) 0%, color-mix(in srgb, var(--surface-sunken), var(--text-1) 7%) 50%, var(--surface-sunken) 100%);
  background-size: 200% 100%; animation: ui-shimmer calc(var(--dur-deliberate) * 4) linear infinite;
}
.w2-scene__lines { display: flex; flex-direction: column; gap: 6px; padding: 0 3px; }
.w2-scene__lines > span { display: block; height: 10px; width: 70%; }
.w2-scene__lines > span + span { width: 45%; }
:root[data-motion="reduced"] .w2-scene.is-skeleton .w2-scene__thumb, :root[data-motion="reduced"] .w2-scene.is-skeleton .w2-scene__lines > span { animation: none !important; }
@media (max-width: 700px) {
  .w2-scenes__grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
  .w2-scenes__head .ui-btn__label { display: none; }
}
