/* ============================================================
   The shell: desktop, wallpaper, top bar, dock, overview
   ============================================================ */

.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  animation: ud-fade-in 260ms ease both;
}

/* ---------------- Wallpaper ---------------- */
.wallpaper {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 620ms ease, transform 620ms var(--ease-shell);
  transform: scale(1.02);
}
.wallpaper.will-change { opacity: 0; }
.night-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(255, 147, 41, .30), rgba(255, 190, 120, .12));
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 900ms ease;
}
.night-light.on { opacity: 1; }

.desktop-surface { position: absolute; inset: 0; }

/* ---------------- Top bar ---------------- */
.panel {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--panel-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--c-panel-bg);
  color: var(--c-panel-fg);
  z-index: var(--z-panel);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .18);
  font-size: var(--fs-md);
  user-select: none;
}
.panel.overview-open {
  background: rgba(20, 20, 20, .55);
  box-shadow: none;
  backdrop-filter: blur(0px);
}
.panel-left, .panel-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.panel-right { justify-content: flex-end; }
.panel-center { display: flex; justify-content: center; }

.panel-activities {
  height: 27px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--c-panel-fg);
  font-weight: 500;
  letter-spacing: .1px;
  white-space: nowrap;
  transition: background var(--dur-fast) ease;
}
.panel-activities:hover { background: rgba(255, 255, 255, .1); }
.panel-activities:active { background: rgba(255, 255, 255, .16); }
.panel-activities.is-open { background: rgba(255, 255, 255, .14); }

/* Focused-app label (Ubuntu shows the active window title in the top bar) */
.panel-focus {
  padding-left: 8px;
  color: rgba(255, 255, 255, .74);
  font-size: var(--fs-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.panel-clock {
  height: 27px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--c-panel-fg);
  transition: background var(--dur-fast) ease;
  white-space: nowrap;
}
.panel-clock:hover { background: rgba(255, 255, 255, .1); }
.panel-clock[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.panel-clock-date { color: rgba(255, 255, 255, .78); }
.panel-clock-time { font-weight: 500; }
.panel-clock.is-urgent .panel-clock-time { color: #FFB37B; }

.panel-indicators { display: flex; align-items: center; gap: 1px; padding-right: 2px; }
.panel-ind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 6px;
  border-radius: 5px;
  color: var(--c-panel-fg);
  font-size: var(--fs-sm);
  transition: background var(--dur-fast) ease;
  white-space: nowrap;
}
.panel-ind:hover { background: rgba(255, 255, 255, .1); }
.panel-ind svg { width: 15px; height: 15px; opacity: .95; }
.panel-ind.clickable { cursor: pointer; }
.panel-ind .ind-badge {
  min-width: 15px;
  height: 15px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.panel-status {
  height: 27px;
  padding: 0 8px 0 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-panel-fg);
  transition: background var(--dur-fast) ease;
}
.panel-status:hover { background: rgba(255, 255, 255, .1); }
.panel-status[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.panel-status-icons { display: inline-flex; align-items: center; gap: 5px; }
.panel-status-icons svg { width: 15px; height: 15px; }
.panel-status-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, .7);
  transition: transform var(--dur) var(--ease-window);
}
.panel-status[aria-expanded="true"] .panel-status-caret { transform: rotate(180deg); }

/* ---------------- Dock (Ubuntu dock / dash-to-dock) ---------------- */
.dock-layer {
  position: absolute;
  left: 0; top: var(--panel-h); bottom: 0;
  width: calc(var(--dock-icon) + var(--dock-pad) * 2 + 6px);
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  padding: 0 0 0 3px;
  pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-shell), opacity var(--dur) ease;
}
.dock-layer.autohide { transform: translateX(calc(-100% - 8px)); opacity: 0; }
.dock-layer.autohide.peek { transform: translateX(0); opacity: 1; }

.dock {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 14px;
  background: var(--c-shell);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .07);
  max-height: calc(100% - 12px);
  overflow: visible;
  scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock.is-scrolling { overflow-y: auto; }

.dock-item {
  position: relative;
  width: calc(var(--dock-icon) + 8px);
  height: calc(var(--dock-icon) + 8px);
  display: grid;
  place-items: center;
  border-radius: 10px;
  flex: 0 0 auto;
  transition: background var(--dur-fast) ease, transform 170ms var(--ease-shell);
  -webkit-tap-highlight-color: transparent;
}
.dock-item:hover { background: rgba(255, 255, 255, .12); }
.dock-item:active .dock-icon { transform: scale(.9); }
.dock-icon {
  width: var(--dock-icon);
  height: var(--dock-icon);
  transition: transform 170ms var(--ease-shell);
  transform-origin: center bottom;
}
.dock-item:hover .dock-icon { transform: scale(1.08); }
.dock-item:active .dock-icon { transform: scale(.94); }
.dock-item.launching { animation: ud-dock-bounce 720ms var(--ease-snap); }
.dock-item.urgent .dock-icon { animation: ud-dock-urgent 900ms ease-in-out 2; }
.dock-item.drag-over { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* running indicator: the small pill under a running app */
.dock-dots {
  position: absolute;
  bottom: 1px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
}
.dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 3px rgba(0, 0, 0, .45);
  opacity: .95;
  transition: width 180ms var(--ease-window), border-radius 180ms ease;
}
.dock-dot.focused { width: 13px; border-radius: 3px; background: var(--accent); }
.dock-item.urgent .dock-dot { background: var(--accent); }

.dock-sep {
  width: calc(var(--dock-icon) - 10px);
  height: 1px;
  background: rgba(255, 255, 255, .22);
  margin: 5px 0;
  flex: 0 0 auto;
}

.dock-edge { position: absolute; left: 0; top: var(--panel-h); bottom: 0; width: 4px; z-index: var(--z-dock); }

/* ---------------- Window layer ---------------- */
.window-layer { position: absolute; inset: 0; z-index: var(--z-window); pointer-events: none; }
.snap-preview {
  position: absolute;
  z-index: calc(var(--z-window) - 1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25) inset;
  opacity: 0;
  transition: opacity var(--dur-fast) ease, left 90ms var(--ease-window), top 90ms var(--ease-window),
              width 90ms var(--ease-window), height 90ms var(--ease-window);
  pointer-events: none;
}
.snap-preview.on { opacity: 1; }

/* ---------------- Activities overview ---------------- */
.overview {
  position: absolute;
  inset: 0;
  z-index: var(--z-overview);
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  animation: ud-overview-in var(--dur) ease both;
  user-select: none;
}
.overview.closing { animation: ud-fade-out 140ms ease both; }

.overview-search-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 0 10px;
  flex: 0 0 auto;
}
.overview-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, 74vw);
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.overview-search:focus-within {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}
.overview-search-icon { width: 16px; height: 16px; opacity: .8; flex: 0 0 auto; }
.overview-search-icon svg { width: 16px; height: 16px; }
.overview-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: #fff;
  font-size: var(--fs-lg);
}
.overview-search-input::placeholder { color: rgba(255, 255, 255, .58); }
.overview-search-clear { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: rgba(255,255,255,.75); }
.overview-search-clear:hover { background: rgba(255, 255, 255, .18); }
.overview-search-clear svg { width: 10px; height: 10px; }

.overview-stage { position: relative; flex: 1 1 auto; min-height: 0; }

/* Workspace column on the right (GNOME 40+) */
.overview-workspaces {
  position: absolute;
  right: 12px;
  top: 0; bottom: 0;
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 3;
}
.ws-thumb {
  position: relative;
  width: 42px;
  height: 30px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-window), background var(--dur-fast) ease, height var(--dur) var(--ease-window);
  flex: 0 0 auto;
}
.ws-thumb:hover { background: rgba(255, 255, 255, .22); }
.ws-thumb.active { background: rgba(255, 255, 255, .38); border-color: rgba(255, 255, 255, .6); }
.ws-thumb.drop-target { background: color-mix(in srgb, var(--accent) 55%, transparent); transform: scale(1.08); }
.ws-thumb .ws-mini {
  position: absolute;
  border-radius: 2px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(0, 0, 0, .3);
}
.ws-add {
  width: 42px; height: 30px;
  border-radius: 5px;
  border: 1px dashed rgba(255, 255, 255, .4);
  color: rgba(255, 255, 255, .7);
  display: grid; place-items: center;
  font-size: 16px;
  flex: 0 0 auto;
}
.ws-add:hover { background: rgba(255, 255, 255, .16); }

/* Window spread + app grid share the stage */
.overview-spread, .overview-grid, .overview-results {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 78px 22px 96px;
}
.overview-grid { flex-direction: column; gap: 12px; padding-bottom: 18px; }
.overview-results { padding: 6px 40px 26px 40px; align-items: flex-start; justify-content: flex-start; overflow: auto; }

/* Window spread */
.spread-win {
  position: absolute;
  border-radius: 9px;
  overflow: hidden;
  background: var(--c-window-bg);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .48);
  cursor: pointer;
  transition: transform 260ms var(--ease-shell), box-shadow var(--dur) ease, opacity var(--dur) ease;
  transform-origin: center center;
}
.spread-win:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 14px 34px rgba(0, 0, 0, .55); }
.spread-win.entering { opacity: 0; transform: scale(.82); }
.spread-win.leaving { opacity: 0; transform: scale(.86); pointer-events: none; }
.spread-win.dragging { opacity: .85; z-index: 50; }
.spread-win .spread-body { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.spread-win .spread-body > * { position: absolute; top: 0; left: 0; }
.spread-win .spread-title {
  position: absolute;
  left: 0; right: 0; bottom: -26px;
  text-align: center;
  font-size: var(--fs-md);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  pointer-events: none;
}
.spread-win .spread-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #E95420;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-snap);
  z-index: 3;
}
.spread-win:hover .spread-close { opacity: 1; }
.spread-close:hover { transform: scale(1.1); }
.spread-close svg { width: 9px; height: 9px; }

/* App grid */
.app-grid-viewport {
  width: min(760px, 76vw);
  max-height: 100%;
  overflow: hidden;
  position: relative;
}
.app-grid-page {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px 6px;
  justify-items: center;
  align-content: start;
  width: 100%;
}
.app-grid-page.slide-l { animation: ud-appgrid-slide-left 220ms var(--ease-shell) both; }
.app-grid-page.slide-r { animation: ud-appgrid-slide-right 220ms var(--ease-shell) both; }

.app-icon-cell {
  width: 92px;
  padding: 10px 4px 8px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background var(--dur-fast) ease, transform 170ms var(--ease-shell);
  position: relative;
}
.app-icon-cell:hover { background: rgba(255, 255, 255, .12); }
.app-icon-cell:active { transform: scale(.95); }
.app-icon-cell.is-dragging { opacity: .45; }
.app-icon-cell.drop-before::before,
.app-icon-cell.drop-after::after {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  width: 2px;
  background: #fff;
  border-radius: 1px;
}
.app-icon-cell.drop-before::before { left: -4px; }
.app-icon-cell.drop-after::after { right: -4px; }
.app-icon-cell.drop-on { background: rgba(255, 255, 255, .26); }
.app-icon-art {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  transition: transform 170ms var(--ease-shell);
}
.app-icon-art svg, .app-icon-art img { width: 52px; height: 52px; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45)); }
.app-icon-cell:hover .app-icon-art { transform: scale(1.07); }
.app-icon-label {
  font-size: var(--fs-sm);
  color: #fff;
  text-align: center;
  line-height: 1.25;
  max-height: 30px;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
  word-break: break-word;
  padding: 0 2px;
}
.app-folder-art { position: relative; width: 52px; height: 52px; }
.app-folder-art .folder-back {
  position: absolute; inset: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
}
.app-folder-art .folder-mini {
  position: absolute;
  width: 21px; height: 21px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.app-folder-art .folder-mini svg, .app-folder-art .folder-mini img { width: 100%; height: 100%; filter: none; }

.app-grid-pager { display: flex; gap: 7px; height: 14px; align-items: center; }
.app-grid-pager button {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .32);
  transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-snap);
}
.app-grid-pager button:hover { background: rgba(255, 255, 255, .55); }
.app-grid-pager button.active { background: #fff; transform: scale(1.25); }

/* folder popup in the app grid */
.folder-popup {
  position: absolute;
  z-index: 20;
  width: 372px;
  max-width: 86vw;
  padding: 14px;
  border-radius: 16px;
  background: rgba(46, 46, 46, .92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .1);
  animation: ud-pop-in 180ms var(--ease-shell) both;
}
.folder-popup .folder-title { color: #fff; text-align: center; font-weight: 500; margin-bottom: 8px; }
.folder-popup .folder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

/* search results */
.overview-results .res-group { width: 100%; margin-bottom: 18px; }
.overview-results .res-head {
  color: rgba(255, 255, 255, .72);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}
.res-list { display: flex; flex-direction: column; gap: 2px; }
.res-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
  min-width: 0;
}
.res-row:hover { background: rgba(255, 255, 255, .14); }
.res-row.selected { background: rgba(255, 255, 255, .2); }
.res-row .res-icon { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; }
.res-row .res-icon svg { width: 24px; height: 24px; }
.res-row .res-main { min-width: 0; flex: 1; }
.res-row .res-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .res-sub { font-size: var(--fs-xs); color: rgba(255, 255, 255, .62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .res-kind { font-size: var(--fs-xs); color: rgba(255, 255, 255, .5); flex: 0 0 auto; }
.res-empty { color: rgba(255, 255, 255, .6); padding: 24px 12px; }

.overview-hint {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255, 255, 255, .45);
  font-size: var(--fs-sm);
  pointer-events: none;
}

/* ---------------- App switcher (Alt+Tab) ---------------- */
.app-switcher {
  position: absolute;
  inset: 0;
  z-index: calc(var(--z-overview) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: ud-fade-in 120ms ease both;
}
.switcher-inner {
  display: flex;
  gap: 14px;
  padding: 22px 26px;
  border-radius: 18px;
  background: rgba(30, 30, 30, .82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .1);
  max-width: min(880px, 90vw);
  overflow-x: auto;
  align-items: center;
}
.switcher-item {
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-radius: 12px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .72);
  transition: background var(--dur-fast) ease, transform 170ms var(--ease-shell);
}
.switcher-item.selected { background: rgba(255, 255, 255, .18); color: #fff; transform: scale(1.04); }
.switcher-item .sw-icon { width: 64px; height: 64px; display: grid; place-items: center; }
.switcher-item .sw-icon svg { width: 60px; height: 60px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.switcher-item .sw-label { font-size: var(--fs-sm); text-align: center; max-height: 30px; overflow: hidden; }
.switcher-item .sw-sub { font-size: var(--fs-xs); opacity: .6; }

/* ---------------- Notifications & toasts ---------------- */
.notification-layer {
  position: absolute;
  top: calc(var(--panel-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(430px, 94vw);
  pointer-events: none;
}
.notification {
  pointer-events: auto;
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(53, 53, 53, .94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #F6F5F4;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .08);
  animation: ud-notif-in 220ms var(--ease-shell) both;
  overflow: hidden;
}
.notification.closing { animation: ud-notif-out 180ms var(--ease-shell) both; }
.notification.crit { background: rgba(96, 32, 26, .95); }
.notification .notif-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; }
.notification .notif-icon svg { width: 28px; height: 28px; }
.notification .notif-body { flex: 1; min-width: 0; }
.notification .notif-title { font-weight: 700; font-size: var(--fs-md); }
.notification .notif-text { font-size: var(--fs-sm); color: rgba(246, 245, 244, .84); overflow-wrap: anywhere; }
.notification .notif-time { font-size: var(--fs-xs); color: rgba(246, 245, 244, .55); margin-top: 3px; }
.notification .notif-actions { display: flex; gap: 8px; margin-top: 10px; }
.notification .notif-actions button {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--dur-fast) ease;
}
.notification .notif-actions button:hover { background: rgba(255, 255, 255, .2); }

.toast-layer {
  position: absolute;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(53, 53, 53, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #F6F5F4;
  font-size: var(--fs-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  animation: ud-toast-in 200ms var(--ease-shell) both;
}
.toast.closing { animation: ud-toast-out 180ms var(--ease-shell) both; }

/* ---------------- OSD (volume / brightness) ---------------- */
.osd {
  position: absolute;
  bottom: 118px;
  left: 50%;
  transform: translateX(-50%);
  z-index: calc(var(--z-notification) + 5);
  pointer-events: none;
}
.osd-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 268px;
  padding: 14px 20px;
  border-radius: 16px;
  background: rgba(40, 40, 40, .9);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .1);
  animation: ud-osd-in 1500ms ease both;
}
.osd-inner svg { width: 22px; height: 22px; flex: 0 0 auto; }
.osd-inner .osd-bar { flex: 1; }

.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 2000; }
.flash.on { animation: ud-flash 340ms ease both; }

/* ---------------- Session screens ---------------- */
.boot {
  position: fixed; inset: 0; z-index: var(--z-session);
  background: #2C001E;
  display: grid; place-items: center;
  color: #fff;
  animation: ud-fade-in 200ms ease both;
}
.boot.closing { animation: ud-fade-out 320ms ease both; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot-logo svg { width: 132px; height: 132px; }
.boot-ring { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 6; }
.boot-dot { fill: rgba(255, 255, 255, .2); }
.boot-centre { fill: #fff; }
.boot-dot-t { animation: ud-boot-dot 1500ms ease-in-out infinite; }
.boot-dot-l { animation: ud-boot-dot 1500ms ease-in-out 200ms infinite; }
.boot-dot-r { animation: ud-boot-dot 1500ms ease-in-out 400ms infinite; }
.boot-spinner { display: flex; gap: 6px; }
.boot-spinner span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #E95420;
  animation: ud-boot-dot 1400ms ease-in-out infinite;
}
.boot-spinner span:nth-child(2) { animation-delay: 120ms; }
.boot-spinner span:nth-child(3) { animation-delay: 240ms; }
.boot-spinner span:nth-child(4) { animation-delay: 360ms; }
.boot-spinner span:nth-child(5) { animation-delay: 480ms; }
.boot-vendor {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 2px;
  opacity: .82;
}

.login {
  position: fixed; inset: 0; z-index: var(--z-session);
  color: #fff;
  display: flex;
  flex-direction: column;
  animation: ud-session-in 420ms var(--ease-shell) both;
}
.login-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(14px) saturate(1.1); transform: scale(1.08); }
.login-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.35) 40%, rgba(0,0,0,.62)); }
.login-topbar {
  position: relative;
  height: var(--panel-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: rgba(30, 30, 30, .62);
  font-size: var(--fs-md);
}
.login-brand { font-weight: 500; letter-spacing: .5px; opacity: .9; padding-left: 6px; }
.login-topbar-right { display: flex; align-items: center; gap: 4px; }
.login-topbar-right .login-ind { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 27px; border-radius: 5px; font-size: var(--fs-sm); }
.login-topbar-right .login-ind svg { width: 15px; height: 15px; }
.login-ind.clickable { cursor: pointer; }
.login-ind.clickable:hover { background: rgba(255, 255, 255, .12); }

.login-stage { position: relative; flex: 1; display: grid; place-items: center; padding: 20px; }
.login-userlist { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.login-user {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur-fast) ease, transform var(--dur) var(--ease-shell);
}
.login-user:hover { background: rgba(255, 255, 255, .12); }
.login-user.selected { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.login-user .lu-avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.login-user .lu-avatar svg, .login-user .lu-avatar img { width: 100%; height: 100%; }
.login-user .lu-name { font-size: var(--fs-xl); font-weight: 400; }
.login-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(340px, 90vw); }
.login-avatar { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; box-shadow: 0 6px 22px rgba(0, 0, 0, .5), 0 0 0 3px rgba(255, 255, 255, .18); }
.login-avatar svg, .login-avatar img { width: 100%; height: 100%; }
.login-name { font-size: var(--fs-2xl); font-weight: 400; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.login-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.login-pw-wrap { position: relative; display: flex; align-items: center; }
.login-pw {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: var(--fs-md);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
}
.login-pw::placeholder { color: rgba(255, 255, 255, .55); }
.login-pw:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .16); }
.login-eye {
  position: absolute; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .7);
}
.login-eye:hover { background: rgba(255, 255, 255, .14); }
.login-eye svg { width: 16px; height: 16px; }
.login-msg { min-height: 16px; font-size: var(--fs-sm); color: #FF9B7B; text-align: center; }
.login-signin {
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  transition: filter var(--dur-fast) ease, scale var(--dur-fast) var(--ease-snap);
}
.login-signin:hover { filter: brightness(1.1); }
.login-signin:active { scale: .98; }
.login-hint { font-size: var(--fs-sm); color: rgba(255, 255, 255, .55); text-align: center; }
.login-bottom {
  position: relative;
  display: flex; justify-content: flex-end;
  padding: 14px 18px;
}
.login-bottom-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  transition: background var(--dur-fast) ease;
}
.login-bottom-btn:hover { background: rgba(255, 255, 255, .16); }
.login-bottom-btn svg { width: 20px; height: 20px; }
.login.shake .login-panel { animation: ud-shake 420ms ease both; }

/* Lock screen */
.lock {
  position: fixed; inset: 0; z-index: var(--z-session);
  color: #fff;
  overflow: hidden;
  animation: ud-session-in 380ms var(--ease-shell) both;
}
.lock-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(20px) brightness(.82) saturate(1.15); transform: scale(1.1); transition: filter 500ms ease; }
.lock.showing-form .lock-bg { filter: blur(26px) brightness(.55) saturate(1.05); }
.lock-clock {
  position: absolute;
  top: 22%;
  left: 0; right: 0;
  text-align: center;
  transition: transform 460ms var(--ease-shell), opacity 300ms ease;
}
.lock.showing-form .lock-clock { transform: translateY(-58px) scale(.86); opacity: .9; }
.lock-time { font-size: clamp(56px, 12vw, 104px); font-weight: 300; letter-spacing: -2px; line-height: 1; text-shadow: 0 4px 24px rgba(0, 0, 0, .5); }
.lock-date { font-size: clamp(16px, 2.4vw, 22px); opacity: .85; margin-top: 6px; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.lock-shield {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.9);
  width: min(340px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, transform 420ms var(--ease-shell);
}
.lock.showing-form .lock-shield { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.lock-avatar { width: 78px; height: 78px; border-radius: 50%; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.5), 0 0 0 3px rgba(255,255,255,.16); }
.lock-avatar svg, .lock-avatar img { width: 100%; height: 100%; }
.lock-name { font-size: var(--fs-xl); text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.lock-form { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.lock-hint { font-size: var(--fs-sm); color: rgba(255, 255, 255, .55); }
.lock-cancel { color: rgba(255, 255, 255, .75); font-size: var(--fs-sm); text-decoration: underline; }
.lock-swipe-hint {
  position: absolute; bottom: 26px; left: 0; right: 0;
  text-align: center; color: rgba(255, 255, 255, .55); font-size: var(--fs-sm);
  transition: opacity 300ms ease;
}
.lock.showing-form .lock-swipe-hint { opacity: 0; }
.lock.shake .lock-shield { animation: ud-shake 420ms ease both; }

/* Suspend */
.suspend {
  position: fixed; inset: 0; z-index: var(--z-session);
  background: #050505;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .5);
  animation: ud-fade-in 700ms ease both;
}
.suspend-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.suspend-icon {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: rgba(255, 255, 255, .8);
  animation: ud-spin 3.4s linear infinite;
}
.suspend-text { font-size: var(--fs-lg); }
.suspend-sub { font-size: var(--fs-sm); opacity: .7; }

/* Shutdown */
.shutdown {
  position: fixed; inset: 0; z-index: var(--z-session);
  background: #0A0A0A;
  color: #D6D6D6;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow: hidden;
  animation: ud-fade-in 240ms ease both;
}
.shutdown-log { margin: 0; padding: 26px 30px; white-space: pre-wrap; line-height: 1.6; }
.shutdown-log .ok { color: #4EC97B; }
.shutdown-log .fail { color: #E95420; }
.shutdown-log .dim { color: #6B6B6B; }
.shutdown-log .hl { color: #F6F5F4; }
.shutdown-done { position: absolute; inset: 0; display: grid; place-items: center; }
.shutdown-done-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.shutdown-power {
  width: 78px; height: 78px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background var(--dur) ease, box-shadow var(--dur) ease, border-color var(--dur) ease;
  animation: ud-fade-in 600ms ease both;
}
.shutdown-power:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); box-shadow: 0 0 26px rgba(233, 84, 32, .5); }
.shutdown-power svg { width: 34px; height: 34px; color: rgba(255, 255, 255, .8); }
.shutdown-done-text { color: #777; font-family: var(--font-ui); font-size: var(--fs-md); }
