.aether-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.wallpaper-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.45s var(--ease-smooth), transform 0.6s var(--ease-spring);
  z-index: 0;
}

.brightness-dimmer {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
  transition: opacity 0.2s ease;
}

/* Glass Surfaces */
.glass-bar {
  background: var(--glass-menubar);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

.glass-panel,
.glass-popover {
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-panel), inset 0 1px 0 var(--glass-highlight);
}

.glass-dock {
  background: var(--glass-dock);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-highlight);
}

/* Menu Bar */
.menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--menubar-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: calc(10px + var(--safe-left));
  padding-right: calc(10px + var(--safe-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 900;
  font-size: 13px;
  font-weight: 500;
}

.menu-bar-left,
.menu-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.menu-pill {
  background: transparent;
  border: none;
  border-radius: 7px;
  height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.14s ease;
  white-space: nowrap;
}

.menu-pill:hover,
.menu-pill.active {
  background: var(--glass-bg-subtle);
}

.menu-brand-btn {
  padding: 0 8px;
}

.brand-glyph {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-active-app {
  font-weight: 700;
  padding: 0 8px 0 4px;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.app-menu-items {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menu-icon-btn {
  width: 28px;
  padding: 0;
  justify-content: center;
}

.menu-icon-btn svg {
  width: 15px;
  height: 15px;
}

.menu-space-pill {
  font-size: 11.5px;
  background: var(--glass-bg-subtle);
  padding: 0 8px;
}

.menu-clock-btn {
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.notif-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Menu Dropdown & Context Menu */
.menu-dropdown,
.context-menu {
  position: fixed;
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  z-index: 1200;
  animation: popIn 0.16s var(--ease-spring);
}

.menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.menu-item:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}

.menu-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.menu-item-shortcut {
  font-size: 11px;
  opacity: 0.65;
}

.menu-divider {
  height: 1px;
  margin: 5px 6px;
  background: var(--divider);
}

/* Desktop Surface & Draggable Icons */
.desktop-area {
  position: absolute;
  top: calc(var(--menubar-height) + var(--safe-top));
  left: var(--safe-left);
  right: var(--safe-right);
  bottom: 0;
  z-index: 10;
  overflow: hidden;
}

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.desktop-icon {
  position: absolute;
  width: 84px;
  padding: 8px 4px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  touch-action: none;
  transition: background 0.14s ease, transform 0.12s ease;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.11);
}

.desktop-icon.selected {
  background: rgba(10, 132, 255, 0.34);
  outline: 1px solid rgba(255, 255, 255, 0.32);
}

.desktop-icon.dragging {
  opacity: 0.85;
  transform: scale(1.06);
  z-index: 40;
}

.desktop-icon-art {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.desktop-icon-art svg {
  width: 48px;
  height: 48px;
}

.desktop-icon-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Bottom Dock */
.dock-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(10px + var(--safe-bottom));
  display: flex;
  justify-content: center;
  padding: 0 12px;
  z-index: 950;
  pointer-events: none;
  transition: transform 0.28s var(--ease-spring), opacity 0.25s ease;
}

.dock-container.auto-hidden {
  transform: translateY(calc(100% + 16px));
  opacity: 0.15;
}

.dock {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 22px;
  max-width: calc(100vw - 24px - var(--safe-left) - var(--safe-right));
  overflow-x: auto;
  scrollbar-width: none;
}

.dock::-webkit-scrollbar {
  display: none;
}

.dock-item {
  position: relative;
  width: var(--dock-icon-size, 48px);
  height: var(--dock-icon-size, 48px);
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}

.dock-item svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
}

@media (hover: hover) {
  .dock-item:hover {
    transform: translateY(-8px) scale(1.18);
  }
}

.dock-item:active {
  transform: scale(0.92);
}

.dock-item.bouncing {
  animation: dockBounce 0.55s var(--ease-spring);
}

.dock-indicator {
  position: absolute;
  bottom: -6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--text-primary);
  opacity: 0.85;
}

.dock-divider {
  width: 1px;
  height: 36px;
  margin: 0 2px;
  background: var(--divider);
  align-self: center;
  flex-shrink: 0;
}

.dock-tooltip {
  position: fixed;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--glass-bg-elevated);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  z-index: 1200;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

/* Control Center & Notification Center */
.control-center {
  position: fixed;
  top: calc(var(--menubar-height) + var(--safe-top) + 8px);
  right: calc(10px + var(--safe-right));
  width: min(336px, calc(100vw - 20px));
  border-radius: 20px;
  padding: 14px;
  z-index: 1100;
  animation: popIn 0.2s var(--ease-spring);
}

.cc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cc-card {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-card.span-2 {
  grid-column: span 2;
}

.cc-toggle-btn {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.cc-circle-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--glass-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.cc-toggle-btn.active .cc-circle-icon {
  background: var(--accent);
  color: #fff;
}

.cc-toggle-title {
  font-size: 13px;
  font-weight: 600;
}

.cc-toggle-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.cc-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.cc-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.cc-wallpaper-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cc-wall-thumb {
  height: 44px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cc-wall-thumb.active {
  border-color: var(--accent);
  transform: scale(1.03);
}

/* Notification Center */
.notification-center {
  position: fixed;
  top: calc(var(--menubar-height) + var(--safe-top) + 8px);
  right: calc(10px + var(--safe-right));
  width: min(352px, calc(100vw - 20px));
  max-height: calc(100vh - var(--menubar-height) - var(--safe-top) - 96px);
  border-radius: 20px;
  padding: 14px;
  z-index: 1100;
  overflow-y: auto;
  animation: popIn 0.2s var(--ease-spring);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nc-widget-card {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 12px;
}

.nc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}

.nc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nc-item {
  background: var(--surface-card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.nc-item-title {
  font-size: 13px;
  font-weight: 600;
}

.nc-item-body {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.nc-item-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Spotlight, Launchpad, Mission Control */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(14vh + var(--safe-top));
  z-index: 1500;
}

.spotlight-modal {
  width: min(620px, calc(100vw - 28px));
  border-radius: 18px;
  overflow: hidden;
  animation: popIn 0.18s var(--ease-spring);
}

.spotlight-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}

.spotlight-search-icon svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 17px;
  font-weight: 500;
}

.spotlight-kbd {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--glass-bg-subtle);
  color: var(--text-secondary);
}

.spotlight-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.spotlight-row {
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.spotlight-row:hover,
.spotlight-row.selected {
  background: var(--accent);
  color: #fff;
}

.spotlight-row-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spotlight-row-icon svg {
  width: 26px;
  height: 26px;
}

.spotlight-row-meta {
  flex: 1;
  min-width: 0;
}

.spotlight-row-title {
  font-size: 14px;
  font-weight: 600;
}

.spotlight-row-sub {
  font-size: 11.5px;
  opacity: 0.72;
}

/* Launchpad */
.launchpad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 24, 0.56);
  backdrop-filter: blur(42px) saturate(160%);
  -webkit-backdrop-filter: blur(42px) saturate(160%);
  z-index: 1450;
  padding: calc(var(--menubar-height) + var(--safe-top) + 28px) 24px calc(92px + var(--safe-bottom));
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.launchpad-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.launchpad-search-wrap {
  width: min(320px, 100%);
}

.launchpad-search {
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  outline: none;
  text-align: center;
}

.launchpad-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 22px 16px;
}

.launchpad-app {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.16s var(--ease-spring), background 0.15s ease;
}

.launchpad-app:hover {
  transform: scale(1.07);
  background: rgba(255, 255, 255, 0.1);
}

.launchpad-app svg {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.launchpad-app-name {
  font-size: 12.5px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Mission Control */
.mission-control-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.65);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  z-index: 1440;
  padding: calc(var(--menubar-height) + var(--safe-top) + 16px) 24px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.2s ease;
}

.mc-spaces-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mc-space-chip {
  padding: 8px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.15s ease;
}

.mc-space-chip.active {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.45);
}

.mc-windows-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  align-content: start;
}

.mc-window-card {
  background: var(--glass-bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.16s var(--ease-spring), border-color 0.15s ease;
}

.mc-window-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.mc-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mc-window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.mc-window-title svg {
  width: 20px;
  height: 20px;
}

.mc-window-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mc-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

/* Lock Screen */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.38s ease, transform 0.42s var(--ease-spring);
}

.lock-screen.unlocked {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.lock-backdrop {
  position: absolute;
  inset: 0;
  background-image: var(--lock-wallpaper, none);
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(0.68);
  transform: scale(1.08);
}

.lock-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: min(560px, 84vh);
  padding: 20px;
  color: #fff;
  text-align: center;
}

.lock-date {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0.92;
}

.lock-time {
  font-size: clamp(56px, 12vw, 88px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.lock-user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lock-avatar {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.lock-username {
  font-size: 18px;
  font-weight: 600;
}

.lock-passcode-input {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  color: #fff;
  text-align: center;
  outline: none;
  width: 190px;
}

.btn-unlock {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-unlock:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.lock-error {
  color: #ff6961;
  font-size: 12.5px;
  font-weight: 600;
}

/* Confirmation Modal & Toast */
.confirm-modal {
  width: min(380px, calc(100vw - 32px));
  border-radius: 18px;
  padding: 20px;
  animation: popIn 0.18s var(--ease-spring);
}

.confirm-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.confirm-message {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-container {
  position: fixed;
  top: calc(var(--menubar-height) + var(--safe-top) + 12px);
  right: calc(12px + var(--safe-right));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast-banner {
  pointer-events: auto;
  width: min(320px, calc(100vw - 24px));
  background: var(--glass-bg-elevated);
  backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 11px 14px;
  box-shadow: var(--shadow-panel);
  animation: slideInRight 0.24s var(--ease-spring);
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
}

.toast-body {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Shared Buttons */
.btn {
  border: none;
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  transition: opacity 0.14s ease, transform 0.12s ease, background 0.14s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--glass-bg-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(128, 138, 158, 0.24);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* Animations */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes dockBounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-16px); }
  70% { transform: translateY(-5px); }
}

/* Mobile / Android Responsive Tweaks */
@media (max-width: 720px) {
  .app-menu-items {
    display: none;
  }
  .dock {
    padding: 7px 9px;
    gap: 6px;
    border-radius: 18px;
  }
  .dock-item {
    width: 44px;
    height: 44px;
  }
  .desktop-icon {
    width: 74px;
  }
  .desktop-icon-art {
    width: 44px;
    height: 44px;
  }
  .desktop-icon-art svg {
    width: 42px;
    height: 42px;
  }
}
