:root {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.desktop-body {
  margin: 0;
  font-family: "IBM Plex Sans Condensed", "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050312;
  color: #e7e9ff;
  min-height: 100vh;
  overflow: hidden;
}

.desktop-root {
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-size: 15px;
}

.desktop-root.desktop-root--compact {
  font-size: 13.5px;
}

.desktop-intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.desktop-intro[hidden] {
  display: none;
}

.desktop-intro__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.desktop-intro__dialog {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 32px 32px 28px;
  border-radius: 24px;
  background: rgba(12, 10, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(5, 3, 18, 0.45);
  color: inherit;
}

.desktop-intro__title {
  margin: 0 0 12px;
  font-size: 1.65em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.desktop-intro__lead {
  margin: 0 0 16px;
  font-size: 1.05em;
  line-height: 1.5;
}

.desktop-intro__list {
  margin: 0 0 20px 0;
  padding: 0 0 0 20px;
  display: grid;
  gap: 8px;
  font-size: 0.98em;
  line-height: 1.5;
}

.desktop-intro__remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.95em;
  cursor: pointer;
}

.desktop-intro__remember input {
  width: 18px;
  height: 18px;
  accent-color: #6c63ff;
}

.desktop-intro__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #6c63ff, #00c2ff);
  color: #050312;
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.desktop-intro__action:hover,
.desktop-intro__action:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 194, 255, 0.35);
  outline: none;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(108, 99, 255, 0.45), transparent 55%),
    radial-gradient(circle at 80% 15%, rgba(0, 194, 255, 0.35), transparent 55%),
    linear-gradient(135deg, #050312 0%, #0c0b1f 45%, #010104 100%);
  background-size: cover;
  background-position: center;
  transition: filter 180ms ease, opacity 180ms ease;
  z-index: 0;
}

.desktop-workspace {
  position: absolute;
  inset: 0;
  padding: 24px 24px 120px;
  overflow: hidden;
  z-index: 1;
}

.desktop-taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: color-mix(in srgb, #050312 65%, transparent);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(var(--taskbar-blur, 12px));
  -webkit-backdrop-filter: blur(var(--taskbar-blur, 12px));
  color: inherit;
  z-index: 10;
  transition: transform 200ms ease;
  opacity: calc(var(--taskbar-opacity, 0.88));
}

.desktop-root.taskbar-hidden .desktop-taskbar {
  transform: translateY(100%);
}

.desktop-root.taskbar-hidden .desktop-taskbar:hover,
.desktop-root.taskbar-hidden.taskbar-visible .desktop-taskbar {
  transform: translateY(0%);
}

.taskbar__section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.taskbar__section--windows {
  justify-content: center;
}

.taskbar__section--system {
  justify-content: flex-end;
  gap: 10px;
}

.taskbar__start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.taskbar__start:focus-visible,
.taskbar__start:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.taskbar__pinned,
.taskbar__windows {
  display: flex;
  align-items: center;
  gap: 8px;
}

.taskbar__pinned button,
.taskbar__windows button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.taskbar__pinned button:hover,
.taskbar__windows button:hover,
.taskbar__pinned button:focus-visible,
.taskbar__windows button:focus-visible {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.taskbar__windows button[data-state="active"] {
  border-color: rgba(108, 99, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(108, 99, 255, 0.35);
  background: rgba(108, 99, 255, 0.28);
}

.taskbar__windows button[data-state="minimized"] {
  opacity: 0.65;
}

.taskbar__windows button[data-state="minimized"]:hover,
.taskbar__windows button[data-state="minimized"]:focus-visible {
  opacity: 1;
}

.taskbar__credits {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.taskbar__upgrade {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  font-weight: 600;
}

.taskbar__upgrade:hover,
.taskbar__upgrade:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.taskbar__exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.taskbar__exit:hover,
.taskbar__exit:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.taskbar__clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 64px;
  text-align: center;
}

.taskbar__settings {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
}

.taskbar__settings:hover,
.taskbar__settings:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.desktop-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 420px;
  min-height: 320px;
  max-width: 95vw;
  max-height: calc(95vh - 56px);
  background: rgba(14, 16, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 70px -35px rgba(0, 0, 0, 0.7), 0 18px 40px -22px rgba(3, 5, 35, 0.45);
  transition: box-shadow 150ms ease, border-color 150ms ease;
  z-index: 2;
}

.desktop-window::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(0px);
  pointer-events: none;
  transition: backdrop-filter 160ms ease;
}

.desktop-window.is-active {
  border-color: rgba(108, 99, 255, 0.55);
  box-shadow: 0 40px 90px -35px rgba(0, 0, 0, 0.8), 0 18px 50px -22px rgba(44, 62, 255, 0.45);
}

.desktop-window.is-minimized {
  visibility: hidden;
  pointer-events: none;
}

.desktop-window-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  cursor: grab;
  background: rgba(255, 255, 255, 0.04);
  user-select: none;
}

.desktop-window-header:active {
  cursor: grabbing;
}

.desktop-window-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.desktop-window-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.desktop-window-controls button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
}

.desktop-window-controls button:hover,
.desktop-window-controls button:focus-visible {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
}

.desktop-window-controls button[data-action="close"] {
  background: rgba(255, 86, 86, 0.25);
  border-color: rgba(255, 86, 86, 0.35);
}

.desktop-window-controls button[data-action="close"]:hover,
.desktop-window-controls button[data-action="close"]:focus-visible {
  background: rgba(255, 86, 86, 0.35);
}

.desktop-window-content {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  background: rgba(5, 7, 22, 0.72);
}

.desktop-window iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0c20;
}

.desktop-resize-handle {
  position: absolute;
  z-index: 5;
}

.desktop-resize-handle[data-edge="n"],
.desktop-resize-handle[data-edge="s"] {
  left: 6px;
  right: 6px;
  height: 12px;
  cursor: ns-resize;
}

.desktop-resize-handle[data-edge="n"] {
  top: -4px;
}

.desktop-resize-handle[data-edge="s"] {
  bottom: -4px;
}

.desktop-resize-handle[data-edge="e"],
.desktop-resize-handle[data-edge="w"] {
  top: 6px;
  bottom: 6px;
  width: 12px;
  cursor: ew-resize;
}

.desktop-resize-handle[data-edge="e"] {
  right: -4px;
}

.desktop-resize-handle[data-edge="w"] {
  left: -4px;
}

.desktop-resize-handle[data-edge="ne"],
.desktop-resize-handle[data-edge="nw"],
.desktop-resize-handle[data-edge="se"],
.desktop-resize-handle[data-edge="sw"] {
  width: 16px;
  height: 16px;
}

.desktop-resize-handle[data-edge="ne"] {
  right: -6px;
  top: -6px;
  cursor: nesw-resize;
}

.desktop-resize-handle[data-edge="nw"] {
  left: -6px;
  top: -6px;
  cursor: nwse-resize;
}

.desktop-resize-handle[data-edge="se"] {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.desktop-resize-handle[data-edge="sw"] {
  left: -6px;
  bottom: -6px;
  cursor: nesw-resize;
}

.desktop-launcher,
.desktop-settings {
  position: absolute;
  bottom: 72px;
  left: 24px;
  width: min(520px, 95vw);
  max-height: calc(100vh - 180px);
  padding: 24px;
  border-radius: 24px;
  background: rgba(10, 12, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  z-index: 20;
  color: inherit;
}

.desktop-settings {
  left: auto;
  right: 24px;
}

.desktop-launcher[hidden],
.desktop-settings[hidden] {
  display: none;
}

.launcher__header,
.settings__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.launcher__header h2,
.settings__header h2 {
  margin: 0;
  font-size: 1.4em;
}

.launcher__header p,
.settings__header p {
  margin: 4px 0 0;
  color: rgba(231, 233, 255, 0.78);
}

.launcher__close,
.settings__close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
}

.launcher__search {
  margin: 20px 0;
}

.launcher__search input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 1em;
}

.launcher__categories {
  display: grid;
  gap: 12px;
}

.launcher__actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.launcher__exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.launcher__exit:hover,
.launcher__exit:focus-visible {
  background: rgba(108, 99, 255, 0.2);
  border-color: rgba(108, 99, 255, 0.45);
  transform: translateY(-1px);
}

.launcher__exit-icon {
  font-size: 1.2em;
}

.launcher-category {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
}

.launcher-category summary {
  font-weight: 600;
  font-size: 1.1em;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.launcher-category summary::-webkit-details-marker {
  display: none;
}

.launcher-category summary::after {
  content: "▸";
  margin-left: auto;
  transition: transform 150ms ease;
}

.launcher-category[open] summary::after {
  transform: rotate(90deg);
}

.launcher-category-list {
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.launcher-app {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.launcher-app:hover,
.launcher-app:focus-visible {
  background: rgba(108, 99, 255, 0.25);
  border-color: rgba(108, 99, 255, 0.45);
  transform: translateY(-1px);
}

.launcher-app__meta {
  display: grid;
  gap: 4px;
}

.launcher-app__title {
  font-weight: 600;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.launcher-app__desc {
  color: rgba(231, 233, 255, 0.7);
  font-size: 0.92em;
  line-height: 1.3;
}

.launcher-app__badge {
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.launcher-app__open {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-weight: 600;
}

.launcher-empty {
  padding: 24px;
  text-align: center;
  color: rgba(231, 233, 255, 0.7);
}

.desktop-settings .settings__section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.desktop-settings .settings__section:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 12px;
}

.settings__field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.settings__field--switch {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.settings__field input[type="color"],
.settings__field input[type="file"],
.settings__field select,
.settings__field input[type="range"] {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: inherit;
  padding: 10px 14px;
  font-size: 1em;
}

.settings__field input[type="range"] {
  padding: 0;
  accent-color: #6c63ff;
}

.settings__action,
.settings__upgrade {
  width: fit-content;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  font-weight: 600;
}

.settings__info {
  margin: 16px 0 12px;
}

.settings__note {
  margin-top: 12px;
  color: rgba(231, 233, 255, 0.68);
  font-size: 0.92em;
}

.desktop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 15;
}

.desktop-overlay[hidden] {
  display: none;
}

.desktop-contextmenu {
  position: absolute;
  min-width: 180px;
  background: rgba(8, 10, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 50;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
}

.desktop-contextmenu[hidden] {
  display: none;
}

.desktop-contextmenu button {
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: 0.95em;
  cursor: pointer;
}

.desktop-contextmenu button:hover,
.desktop-contextmenu button:focus-visible {
  background: rgba(108, 99, 255, 0.28);
}

.desktop-contextmenu hr {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 4px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .desktop-workspace {
    padding: 16px 16px 120px;
  }

  .desktop-launcher,
  .desktop-settings {
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
  }
}
