/* Main Desktop's logic */

:root {
  --font-ui: "Figtree", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --color-wallpaper: #16161a;
  --color-surface: #1e1e23;
  --color-surface-alt: #26262d;
  --color-surface-raised: #2c2c34;
  --color-border: #35353d;

  --color-text: #e8e8ec;
  --color-text-dim: #9c9ca6;
  --color-text-faint: #6c6c76;

  --color-accent: #9b6dff;
  --color-accent-dim: #7c5cd6;
  --color-accent-soft: rgba(155, 109, 255, 0.32);
  --color-white-soft: rgba(255, 255, 255, 0.14);

  --radius-window: 6px;
  --radius-panel: 8px;
  --taskbar-height: 46px;

  --titlebar-height: 38px;

  --window-bg-opacity: 80%;

  --color-icon: #9c9ca6;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-wallpaper);
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
  touch-action: manipulation;
}

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#boot-screen.hidden {
  display: none;
}

.boot-post {
  position: absolute;
  left: clamp(10px, 3vw, 40px);
  top: clamp(10px, 3vw, 40px);
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(6px, 1.5vw, 14px);
}

.boot-post.visible {
  display: flex;
}

.boot-lines {
  display: flex;
  flex-direction: column;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: clamp(8px, 2.6vw, 18px);
}

.boot-line {
  white-space: pre;
}

.boot-setup-line {
  font-weight: 700;
  text-decoration: underline;
  cursor: default;
}

.boot-starting-text {
  position: absolute;
  left: clamp(8px, 2.2vw, 20px);
  top: clamp(8px, 2vw, 16px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: clamp(10px, 2vw, 14px);
  display: none;
}

.boot-starting-text.visible {
  display: block;
}

.bios-setup-screen {
  display: none;
  flex-direction: column;
  position: absolute;
  inset: 0;
  padding: clamp(16px, 4vw, 32px);
  box-sizing: border-box;
  color: #ffffff;
  font-family: var(--font-mono);
}

.bios-setup-screen.visible {
  display: flex;
}

.bios-setup-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: clamp(16px, 3vw, 28px);
}

.bios-setup-title {
  font-size: clamp(16px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bios-tabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.bios-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: inherit;
  font-size: clamp(13px, 2.2vw, 20px);
  font-weight: 500;
  padding: 0 0 8px;
  cursor: default;
}

.bios-tab.active {
  color: #ffffff;
  font-weight: 700;
  border-bottom-color: #ffffff;
}

.bios-tab-disabled {
  color: rgba(255, 255, 255, 0.3);
}

.bios-tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: clamp(11px, 2vw, 17px);
  line-height: 1.7;
}

.bios-section-heading {
  font-weight: 700;
}

.bios-row-spacer {
  height: 1em;
}

.bios-info-label {
  font-weight: 700;
}

.bios-exit-row {
  cursor: default;
}

.bios-exit-row-disabled {
  color: rgba(255, 255, 255, 0.3);
}

.boot-restart-logo {
  display: none;
  opacity: 0;
}

.boot-restart-logo.visible {
  display: block;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#loading-screen.fading {
  opacity: 0;
  pointer-events: none;
}

#loading-screen.hidden {
  display: none;
}

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loading-progress-track {
  width: min(340px, 70vw);
  height: 5px;
  background: #2b2b2b;
  border-radius: 3px;
  box-sizing: border-box;
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.25s ease;
}

#loading-asset-log {
  position: relative;
  width: min(340px, 70vw);
  height: 100px;
  overflow: hidden;
  display: none;
}

.loading-log-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  line-height: 20px;
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

#loading-skip-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#loading-skip-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.asset-skip-notice {
  position: fixed;
  right: 5px;
  bottom: 7px;
  z-index: 1000001;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 20px;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.asset-skip-notice.visible {
  opacity: 1;
  pointer-events: auto;
}

.asset-skip-arrow {
  display: inline-block;
  margin-right: 4px;
  animation: assetSkipArrowNudge 1.2s ease-in-out infinite;
}

@keyframes assetSkipArrowNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

#loading-logo.login-anchored {
  position: fixed;
  transform: translate(-50%, -50%) scale(1);
}

#loading-logo.login-anchored.login-settle {
  transition: top 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

#loading-logo.login-fade-out {
  opacity: 0;
}

.login-users {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.login-users.visible {
  opacity: 1;
  pointer-events: auto;
}

.login-users-heading {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 4px;
  transition: opacity 0.15s ease;
}

.login-user-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(320px, 80vw);
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  cursor: default;
  color: #ffffff;
  font-family: var(--font-ui);
}

.login-user-row.login-user-selected {
  border-color: transparent;
}

.login-user-row.login-user-selected .login-user-avatar,
.login-user-row.login-user-selected .login-user-name,
.login-user-row.login-user-selected .login-user-arrow {
  opacity: 0;
}

.login-user-fill {
  position: absolute;
  inset: 0;
  left: 0;
  width: 0%;
  z-index: 2;
  background: #ffffff;
  transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-user-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.login-user-name {
  position: relative;
  flex: 1;
  font-size: 17px;
  font-weight: 500;
}

.login-user-arrow {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  animation: loginArrowNudge 1.6s ease-in-out infinite;
}

@keyframes loginArrowNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

#crash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: #000000;
  color: #ffffff;
  font-family: var(--font-ui);
}

#crash-screen.hidden {
  display: none;
}

.crash-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 0 24px;
  text-align: center;
}

.crash-title {
  font-size: 32px;
  white-space: nowrap;
}

#crash-screen .crash-okay-btn {
  position: absolute;
  left: 50%;
  top: calc(50% + 32px);
  transform: translateX(-50%);
  display: none;
}

.crash-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.crash-stopcode {
  font-size: 14px;
}

.crash-failed {
  font-size: 12px;
  color: var(--color-text-dim);
}

.crash-fish-icon {
  height: 1.4em;
  vertical-align: middle;
  transform: translateY(-1px);
}

#crash-screen.blank .crash-body,
#crash-screen.blank .crash-footer {
  visibility: hidden;
}

button {
  font-family: inherit;
  color: inherit;
}

#wallpaper-layer {
  position: fixed;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  background: var(--color-wallpaper);
  z-index: 0;
  pointer-events: none;
}

#desktop {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  right: 0;
  bottom: 0;
}

#desktop-icons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  height: 100%;
}

.desktop-icon-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
}

.desktop-icon {
  width: 94px;
  padding: 8px 4px;
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
  border: 1px solid transparent;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.desktop-icon.selected {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-dim);
}

.icon-glyph {
  color: var(--color-icon);
}

.desktop-icon .icon-glyph {
  width: 58px;
  height: 58px;
}

.desktop-icon .icon-glyph svg {
  width: 100%;
  height: 100%;
}

.desktop-icon .icon-label {
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.icon-label-iconglyph {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: middle;
}

#taskbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  z-index: 10000;
}

#start-button {
  width: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 32px;
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1;
  cursor: default;
  transition: color 0.12s ease, background 0.12s ease;
}

#start-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent);
}

#start-button.active {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.nextos-start-strike {
  position: absolute;
  top: -0.055em;
  left: -0.51em;
  width: 1.02em;
  height: 0.11em;
  background: currentColor;
  border-radius: 999px;
}

.nextos-start-glyph .nextos-strike-wrap {
  transition: transform 0.1s cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

#start-button.active .nextos-start-glyph .nextos-strike-wrap {
  transform: translate(-50%, -50%) rotate(-135deg);
}

#start-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(420px, 92vw);
  height: min(600px, 86vh);
  height: min(600px, 86dvh);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  padding: 14px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  filter: blur(10px);
  transform: translate(-50%, -50%) scale(0.94);
  pointer-events: none;
  transition: opacity 0.22s ease, filter 0.22s ease, transform 0.22s ease;
}

#start-menu.open {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

#start-menu.hidden {
  display: none;
}

body.dock-open #wallpaper-layer,
body.dock-open #desktop,
body.dock-open #window-layer {
  filter: blur(12px);
  transition: filter 0.22s ease;
}

.dock-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dock-section-programs {
  flex: 1;
  min-height: 0;
}

.dock-section-quicksettings,
.dock-section-power {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}


.dock-quicksettings-row {
  display: flex;
  gap: 6px;
}

.dock-quicksetting-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: var(--radius-panel);
  border: none;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  cursor: default;
}

.dock-quicksetting-btn:hover {
  background: var(--color-accent-soft);
}

.dock-quicksetting-btn .icon-glyph {
  width: 44px;
  height: 44px;
}

.dock-quicksetting-btn .icon-glyph svg {
  width: 100%;
  height: 100%;
}

.dock-quicksetting-btn .icon-label {
  font-size: 12px;
  color: var(--color-text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-power-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.dock-power-btn:hover:not(:disabled) {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.dock-power-btn:disabled {
  opacity: 0.4;
}

.dock-power-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.dock-power-icon svg {
  width: 100%;
  height: 100%;
}

.start-menu-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.start-menu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex: 0 0 auto;
}

.start-menu-username {
  font-size: 17px;
  font-weight: 500;
  color: var(--color-text);
}

.start-menu-search {
  flex: 0 0 auto;
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
}

.start-menu-search::placeholder {
  color: var(--color-text-faint);
}

.start-menu-search:focus {
  outline: none;
  border-color: var(--color-accent-dim);
}

.start-menu-apps {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-content: start;
}

.start-menu-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-panel);
  cursor: default;
}

.start-menu-app:hover {
  background: var(--color-accent-soft);
}

.start-menu-app .icon-glyph {
  width: 44px;
  height: 44px;
}

.start-menu-app .icon-glyph svg { width: 100%; height: 100%; }

.start-menu-app .icon-label {
  font-size: 12px;
  color: var(--color-text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#taskbar-apps {
  display: flex;
  align-items: stretch;
  margin-left: 4px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

#taskbar-apps::-webkit-scrollbar {
  display: none;
}

#taskbar-apps .taskbar-app {
  flex: 0 0 auto;
}

#taskbar-clock {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-left: 1px solid #ffffff;
  color: #ffffff;
  line-height: 1.35;
  user-select: none;
}

#taskbar-clock-time {
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-mono);
}

.show-desktop-btn {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--color-accent-dim);
  border-radius: 0 0 0 6px;
  background: var(--color-accent-soft);
  padding: 0;
  cursor: default;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.show-desktop-btn:hover,
.show-desktop-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

#desktop-icons,
#window-layer {
  transition: opacity 0.25s ease, visibility 0s linear 0s;
}

#taskbar {
  transition: visibility 0s linear 0s;
}

#start-button,
#taskbar-apps,
#taskbar-clock {
  transition: opacity 0.25s ease;
}

body.show-desktop-active #desktop-icons,
body.show-desktop-active #window-layer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

body.show-desktop-active #taskbar {
  background: transparent;
  border-bottom-color: transparent;
  visibility: hidden;
  transition: background 0.25s ease, border-bottom-color 0.25s ease, visibility 0s linear 0.25s;
}

body.show-desktop-active #start-button,
body.show-desktop-active #taskbar-apps,
body.show-desktop-active #taskbar-clock {
  opacity: 0;
}

body.show-desktop-active .show-desktop-btn {
  visibility: visible;
}

body.storm-active {
  pointer-events: none;
}

body.storm-active .window {
  pointer-events: none;
}

.taskbar-app {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 3px 6px 0;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  cursor: default;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.taskbar-app .icon-glyph {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.taskbar-app .icon-glyph svg {
  width: 100%;
  height: 100%;
}

.taskbar-app-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.taskbar-app:hover {
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-app.active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.taskbar-app.active .icon-glyph {
  color: var(--color-accent);
}

.taskbar-app.closing {
  opacity: 0;
  transition: opacity 0.15s ease;
}

#window-layer {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.window {
  position: absolute;
  pointer-events: auto;
  min-width: 260px;
  min-height: 160px;
  max-width: 100vw;
  max-height: calc(100vh - var(--taskbar-height));
  max-height: calc(100dvh - var(--taskbar-height));
}

.window-frame {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--color-surface) var(--window-bg-opacity), transparent);
  border-radius: var(--radius-window);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: border-radius 0.18s ease;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.window.maximized .window-frame {
  border-radius: 0;
}

.window.animating {
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.window.minimizing {
  transition: opacity 0.2s ease-in;
}

.window.closing {
  animation: windowClose 0.16s ease-in forwards;
  pointer-events: none;
}

.window.opening {
  animation: windowOpen 0.16s ease-out forwards;
}

body.fish-lag-active .window.opening {
  animation-timing-function: steps(2, jump-end);
}

.window.pulse-alert .window-frame {
  animation: dialogPulse 0.125s ease-in-out 2;
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes windowClose {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.94); }
}

@keyframes dialogPulse {
  0%, 100% { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 8px var(--color-accent-soft), 0 16px 40px rgba(0, 0, 0, 0.45); }
}

.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  z-index: 5;
}

.resize-handle.nw { top: 0; left: 0; cursor: nwse-resize; }
.resize-handle.ne { top: 0; right: 0; cursor: nesw-resize; }
.resize-handle.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.resize-handle.se { bottom: 0; right: 0; cursor: nwse-resize; }

.window .titlebar {
  position: relative;
  height: var(--titlebar-height);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 0 10px;
  cursor: default;
}

.window .titlebar-title {
  display: block;
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  padding-right: 103px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window.dialog .titlebar-title {
  display: none;
}

.window.onboarding-popup .titlebar-title {
  display: block;
}

.window.dialog-titled .titlebar-title {
  display: block;
}

.window .titlebar-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  right: 10px;
}

.win-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background 0.12s ease;
}

.win-btn svg {
  width: 14px;
  height: 14px;
}

.win-btn.min:hover,
.win-btn.max:hover {
  background: var(--color-white-soft);
}

.win-btn.close:hover {
  background: var(--color-accent-soft);
}

.win-btn.extra {
  margin-right: 12px;
}

.win-btn.extra svg {
  width: 19px;
  height: 19px;
}

.win-btn.extra:hover {
  background: var(--color-white-soft);
}

.window .content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: color-mix(in srgb, var(--color-surface) var(--window-bg-opacity), transparent);
}

.window.dialog {
  height: auto !important;
}

.window.dialog .window-frame {
  position: static;
}

.window.dialog .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 12px;
  padding: 22px 20px;
  text-align: center;
}

.window.dialog .dialog-text {
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.45;
  max-width: 320px;
}

.window.dialog .dialog-heading {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.25;
  max-width: 320px;
}

.window.dialog .dialog-subtext {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.35;
  max-width: 320px;
  margin-top: -8px;
}

.window.onboarding-popup .window-frame {
  border-radius: 12px;
  background: var(--color-surface);
}

.window.onboarding-popup .titlebar {
  background: var(--color-surface-alt);
}

.dialog-buttons {
  display: flex;
  gap: 10px;
}

.dialog-btn {
  padding: 8px 24px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 14px;
  cursor: default;
}

.dialog-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.crash-okay-btn {
  background: #000000;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 0;
}

.crash-okay-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.dialog-btn:disabled {
  opacity: 0.4;
}

.dialog-btn:disabled:hover {
  border-color: var(--color-border);
  color: var(--color-text);
}

.filemanager {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fm-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
}

.fm-nav-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.fm-nav-btn svg { width: 15px; height: 15px; }

.fm-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.fm-nav-btn:disabled {
  color: var(--color-text-faint);
  cursor: default;
}

.fm-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--color-text-dim);
  padding: 4px 10px;
  background: var(--color-surface-alt);
  border-radius: 6px;
}

.fm-breadcrumb-item {
  cursor: default;
  padding: 2px 4px;
  border-radius: 4px;
}

.fm-breadcrumb-item:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
}

.fm-breadcrumb-sep {
  color: var(--color-text-faint);
  font-size: 11px;
}

.fm-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.fm-sidebar {
  width: 215px;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--color-surface) var(--window-bg-opacity), transparent);
  border-right: 1px solid var(--color-border);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
}

.fm-sidebar-section {
  margin-bottom: 10px;
}

.fm-sidebar-heading {
  font-size: 11px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.15s ease 0.08s;
}

.fm-sidebar-item {
  display: flex;
  align-items: center;
  padding: 7px 8px 7px 0;
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-text-dim);
  cursor: default;
}

.fm-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.fm-sidebar-item.active {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

.fm-sidebar-item .fm-icon {
  width: 40px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-sidebar-item .fm-icon svg { width: 18px; height: 18px; }

.fm-sidebar-item .fm-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.15s ease 0.08s;
}

.fm-eject-btn {
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border: none;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex: 0 0 auto;
}

.fm-eject-btn:hover {
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.08);
}

.fm-eject-btn svg { width: 11px; height: 11px; }

.fm-eject-btn.hidden {
  display: none;
}

.fm-main {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.fm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 4px;
}

.fm-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: var(--radius-panel);
  cursor: default;
  border: 1px solid transparent;
}

.fm-entry:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fm-entry.selected {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-dim);
}

.fm-entry .fm-entry-icon {
  width: 48px;
  height: 48px;
  color: var(--color-icon);
}

.fm-entry .fm-entry-icon svg { width: 100%; height: 100%; }

.fm-entry .fm-entry-icon .fm-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-alt);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 45%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='4' width='18' height='16' rx='2' stroke='%239c9ca6' stroke-width='1.4'/%3E%3Ccircle cx='8.5' cy='9.5' r='1.6' stroke='%239c9ca6' stroke-width='1.4'/%3E%3Cpath d='M4.5 16.5L9 12L12.5 15L16 11L19.5 16.5' stroke='%239c9ca6' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.fm-entry .fm-entry-label {
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.fm-empty {
  color: var(--color-text-faint);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.fm-network-view {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 64px;
  padding: 48px 20px;
}

.fm-netpc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 140px;
}

.fm-netpc-icon {
  width: 64px;
  height: 64px;
  color: var(--color-icon);
}

.fm-netpc-icon svg {
  width: 100%;
  height: 100%;
}

.fm-netpc-name {
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  overflow-wrap: anywhere;
}

.fm-netpc-connect-btn {
  padding: 6px 18px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.fm-netpc-connect-btn:hover:not(:disabled) {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.fm-netpc-connect-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

body.network-auth-active #wallpaper-layer,
body.network-auth-active #desktop,
body.network-auth-active #taskbar,
body.network-auth-active #window-layer {
  filter: blur(16px);
  transition: filter 0.35s ease;
}

.netauth-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.netauth-overlay.opening {
  animation: windowOpen 0.16s ease-out forwards;
}

.netauth-overlay.closing {
  animation: windowClose 0.16s ease-in forwards;
  pointer-events: none;
}

.netauth-box {
  width: min(560px, 84vw);
  background: var(--color-surface-raised);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.netauth-title {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.4;
}

.netauth-input {
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  text-align: center;
}

.netauth-input:focus {
  outline: none;
  border-color: var(--color-accent-dim);
}

.netauth-input:disabled {
  opacity: 0.5;
}

.netauth-hint {
  font-size: 12px;
  color: var(--color-text-dim);
}

.netauth-hint.hidden {
  display: none;
}

.netauth-buttons {
  display: flex;
  gap: 12px;
}

.netauth-btn {
  padding: 7px 20px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text-dim);
  opacity: 0.5;
  font-size: 13px;
  font-family: inherit;
  cursor: default;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.netauth-cancel-btn {
  opacity: 1;
  color: var(--color-text);
}

.netauth-cancel-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.netauth-okay-btn:not(:disabled) {
  opacity: 1;
  color: var(--color-text);
}

.netauth-okay-btn:not(:disabled):hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.netauth-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@keyframes netauthShake {
  10%, 90% { transform: translateX(-6px); }
  20%, 80% { transform: translateX(8px); }
  30%, 50%, 70% { transform: translateX(-10px); }
  40%, 60% { transform: translateX(10px); }
}

.netauth-box.shake {
  animation: netauthShake 0.5s;
}

.text-viewer {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
}

.text-viewer-content {
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.text-viewer-heading {
  font-size: 17px;
  font-weight: 700;
  margin-top: 4px;
  min-height: 1.6em;
}

.text-viewer-line {
  min-height: 1.6em;
}

.text-viewer-dialogue {
  font-weight: 700;
}

.text-viewer-italic {
  font-style: italic;
  min-height: 1.6em;
}

.image-viewer {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--color-wallpaper);
}

.image-viewer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.media-player {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.media-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-player audio {
  width: 100%;
  max-width: 480px;
}

.terminal {
  height: 100%;
  overflow-y: auto;
  background: #000000;
  color: #e8e8ec;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  cursor: text;
}

.terminal-line {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-dir {
  color: var(--color-accent);
  font-weight: 600;
}

.term-file {
  color: #e8e8ec;
}

.terminal-input-line {
  display: flex;
  flex-wrap: wrap;
  line-height: 1.6;
}

.terminal-prompt {
  color: var(--color-accent);
  white-space: pre;
}

.terminal-typed {
  color: #e8e8ec;
  white-space: pre-wrap;
  word-break: break-all;
  min-width: 0;
}

.terminal-cursor {
  color: #e8e8ec;
  margin-left: 1px;
  animation: termBlink 1s steps(1) infinite;
}

@keyframes termBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.terminal-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: none;
  pointer-events: none;
}

.pm-page {
  height: 100%;
  overflow-y: auto;
  padding: 18px;
}

.tm-end-task-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: default;
}

.tm-end-task-btn:hover:not(:disabled) {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.tm-end-task-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pm-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pm-card {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pm-disk-card {
  grid-column: 1 / -1;
  align-items: stretch;
}

.pm-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.pm-card-subtitle {
  font-size: 11px;
  color: var(--color-text-faint);
  text-align: center;
}

.pm-gauge {
  position: relative;
  width: 96px;
  height: 96px;
}

.pm-gauge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--color-accent) 0deg, var(--color-surface-alt) 0deg);
}

.pm-gauge-hole {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--color-surface-alt);
}

.pm-gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.pm-app-row {
  display: grid;
  grid-template-columns: 1fr 60px 80px 110px;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.pm-app-row-header {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  border-bottom: 1px solid var(--color-border);
}

.pm-app-name {
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-app-cpu,
.pm-app-ram {
  color: var(--color-text-dim);
  text-align: right;
}

.settings-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.settings-panel {
  max-width: 440px;
  margin: 0 auto;
}

.settings-poweredby {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--color-text-dim);
}

.settings-poweredby-label {
  font-size: 13px;
}

.aboutpc-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 24px;
  text-align: center;
}

.aboutpc-logo-space {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 16px;
}

.aboutpc-device-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 30px;
}

.aboutpc-rows {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 7px;
}

.aboutpc-label {
  text-align: right;
  color: var(--color-text-dim);
  font-size: 15px;
}

.aboutpc-value {
  text-align: left;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
}

.aboutpc-jailbreak-notice {
  margin-top: 14px;
  text-align: center;
  color: var(--color-text-faint);
  opacity: 0.6;
  font-size: 10px;
  line-height: 1.5;
}

.settings-storage-bar {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.settings-storage-used {
  height: 100%;
  background: var(--color-accent);
}

.settings-storage-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-dim);
  text-align: center;
}

.personalization-panel {
  max-width: 480px;
}

.wallpaper-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.wallpaper-type-select,
.wallpaper-fit-select,
.progsim-diff-select {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
}

.wallpaper-type-select:focus,
.wallpaper-fit-select:focus,
.progsim-diff-select:focus {
  outline: none;
  border-color: var(--color-accent-dim);
}

.wallpaper-reset-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.wallpaper-reset-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.wallpaper-reset-btn.hidden {
  display: none;
}

.wallpaper-type-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.wallpaper-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallpaper-swatch-indicator {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  flex: 0 0 auto;
}

.wallpaper-pick-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.wallpaper-pick-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.wallpaper-choose-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.wallpaper-choose-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.wallpaper-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin: 24px 0 12px;
}

.settings-section-title:first-child {
  margin-top: 0;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 12px;
}

.settings-section-header .settings-section-title {
  margin: 0;
}

.settings-section-header:first-child {
  margin-top: 0;
}

.settings-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  width: 100%;
}

.settings-field-label {
  flex: 1;
  font-size: 13px;
  color: var(--color-text-dim);
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  cursor: default;
}

.settings-toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--color-text-dim);
  transition: transform 0.15s ease, background 0.15s ease;
}

.settings-toggle-checkbox:checked + .settings-toggle-slider {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.settings-toggle-checkbox:checked + .settings-toggle-slider::before {
  transform: translateX(20px);
  background: #ffffff;
}

.wallpaper-blur-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.wallpaper-blur-label {
  font-size: 12px;
  color: var(--color-text-dim);
  flex: 0 0 auto;
}

.wallpaper-blur-slider {
  flex: 1;
  accent-color: var(--color-accent);
}

#color-picker-layer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

#color-picker-layer.open {
  opacity: 1;
  pointer-events: auto;
}

.color-picker-card {
  width: min(280px, 92vw);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: scale(0.96);
  transition: transform 0.18s ease;
}

#color-picker-layer.open .color-picker-card {
  transform: scale(1);
}

.color-picker-sv {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}

.color-picker-sv.dragging {
  cursor: grabbing;
}

.color-picker-sv-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-picker-hue {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  cursor: grab;
  touch-action: none;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.color-picker-hue.dragging {
  cursor: grabbing;
}

.color-picker-hue-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-picker-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-preview {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  flex: 0 0 auto;
}

.color-picker-hash {
  color: var(--color-text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

.color-picker-hex-input {
  flex: 1;
  min-width: 0;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 7px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  text-transform: lowercase;
}

.color-picker-hex-input:focus {
  outline: none;
  border-color: var(--color-accent-dim);
}

.color-picker-hex-input.invalid {
  border-color: #e5484d;
}

.color-picker-recent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-picker-recent-row.hidden {
  display: none;
}

.color-picker-recent-swatch {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  padding: 0;
  cursor: default;
  transition: transform 0.1s ease;
}

.color-picker-recent-swatch:hover {
  transform: scale(1.1);
}

.color-picker-buttons {
  justify-content: flex-end;
}

.hex-copy-btn {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: default;
  border-radius: 5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.hex-copy-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.hex-copy-btn svg {
  width: 14px;
  height: 14px;
}

.hex-copy-btn.copied {
  color: #30a46c;
}

.nextos-wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: #ffffff;
  cursor: default;
  user-select: none;
}

.nextos-wordmark-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88em;
  padding: 0.07em 0.2em;
  border-radius: 0.09em;
  background: #ffffff;
  line-height: 1;
}

.nextos-wordmark-badge-text {
  color: #000000;
}

.nextos-wordmark-word {
  margin-left: 0.12em;
  color: #ffffff;
  line-height: 1;
}

.nextos-logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-ui);
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.nextos-logo-text {
  white-space: pre;
}

.nextos-o-wrap {
  position: relative;
  display: inline-block;
}

.nextos-o-char {
  position: relative;
}

.nextos-o-fill {
  position: absolute;
  inset: 0.16em 0.1em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
}

.nextos-strike-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.nextos-strike-center {
  position: absolute;
  top: -0.055em;
  left: -0.3em;
  width: 0.6em;
  height: 0.11em;
  background: #ffffff;
  border-radius: 0;
  z-index: 2;
}

.nextos-strike-outer {
  position: absolute;
  top: -0.055em;
  width: 0.42em;
  height: 0.11em;
  background: #ffffff;
  transform: scaleX(1);
}

.nextos-strike-outer.nextos-strike-left {
  left: -0.51em;
  transform-origin: right center;
  border-radius: 999px 0 0 999px;
}

.nextos-strike-outer.nextos-strike-right {
  left: 0.09em;
  transform-origin: left center;
  border-radius: 0 999px 999px 0;
}

.nt-app {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.nt-row-label {
  font-size: 13px;
  color: var(--color-text);
}

.nt-row-warning {
  font-weight: 600;
}

.nt-trigger-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

.nt-trigger-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.nt-row.dimmed {
  opacity: 0.4;
}

.xvisor-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
}

.xvisor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: default;
}

.xvisor-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.xvisor-row-label {
  font-size: 14px;
}

.xvisor-row-arrow {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-dim);
}

.xvisor-return-row {
  justify-content: flex-start;
  gap: 8px;
}

.xvisor-empty {
  color: var(--color-text-faint);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.xvisor-entry-body {
  padding-top: 4px;
}

.b64-app {
  height: 100%;
  box-sizing: border-box;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.b64-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
}

.b64-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-faint);
  margin-top: -8px;
}

.b64-mode-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.b64-mode-btn {
  padding: 10px 28px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: default;
}

.b64-mode-btn.active {
  border-color: #ffffff;
}

.b64-textarea {
  flex: 1;
  min-height: 100px;
  width: 100%;
  background: var(--color-surface-raised);
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  resize: none;
  box-sizing: border-box;
}

.b64-textarea::placeholder {
  color: var(--color-text-faint);
}

.fish-popup-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  box-sizing: border-box;
}

.fish-app {
  height: 100%;
  box-sizing: border-box;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.fish-hero-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.fish-subtitle {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-faint);
  font-size: 14px;
  flex-shrink: 0;
}

.fish-inline-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.fish-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}

.fish-btn {
  border: none;
  border-radius: var(--radius-panel);
  background: var(--color-surface-raised);
  cursor: default;
  padding: 0;
}

.fish-btn-single {
  flex: 1 1 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fish-btn-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.fish-btn-row {
  flex: 1 1 0;
  height: 50px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.fish-row-track {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fish-btn-row.active .fish-row-track {
  animation: fishFlyBy 1.4s linear infinite;
}

@keyframes fishFlyBy {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.fish-row-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.fish-btn-crash {
  width: 100%;
  height: 50px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.fish-scatter {
  position: absolute;
  inset: 0;
}

.fish-scatter-icon {
  position: absolute;
  width: 28px;
  height: 28px;
  object-fit: contain;
  visibility: hidden;
  animation-name: fishScatterPulse;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes fishScatterPulse {
  0%, 100% { visibility: hidden; }
  50% { visibility: visible; }
}

.fish-crash-caption {
  width: 100%;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
}

.nt-row.dimmed .nt-trigger-btn:hover {
  border-color: var(--color-border);
  color: var(--color-text);
}

.fm-sidebar {
  transition: width 0.22s ease;
}

.sidebar-toggle-btn {
  width: 40px;
  height: 32px;
  margin: 0 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex: 0 0 auto;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.fm-sidebar.sidebar-compact {
  width: 52px;
}

.sidebar-compact .fm-sidebar-heading,
.sidebar-compact .fm-sidebar-item .fm-label {
  opacity: 0;
  transition: opacity 0.1s ease;
}

.sidebar-compact .fm-eject-btn {
  display: none;
}

.sidebar-compact .fm-sidebar-item.active {
  background: transparent;
}

.sidebar-compact .fm-sidebar-item.active .fm-icon {
  position: relative;
  z-index: 0;
}

.sidebar-compact .fm-sidebar-item.active .fm-icon::before {
  content: "";
  position: absolute;
  inset: -4px 4px;
  background: var(--color-accent-soft);
  border-radius: 6px;
  z-index: -1;
}

@media (max-width: 600px) {
  .fm-body {
    position: relative;
  }

  .fm-main {
    padding-left: 62px;
  }

  .fm-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    z-index: 5;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
  }

  :root {
    --radius-window: 4px;
    --radius-panel: 6px;
  }

  .window.onboarding-popup .window-frame {
    border-radius: 7px;
  }

  .netauth-box {
    border-radius: 8px;
  }

  .wallpaper-type-select,
  .wallpaper-fit-select,
  .progsim-diff-select {
    font-size: 15px;
  }
}

body.desktop-blur-active #wallpaper-layer,
body.desktop-blur-active #desktop,
body.desktop-blur-active #taskbar-apps,
body.desktop-blur-active #taskbar-clock,
body.desktop-blur-active .show-desktop-btn {
  filter: blur(16px);
  transition: filter 0.35s ease;
}

body.onboarding-active #desktop,
body.onboarding-active #taskbar {
  pointer-events: none;
}

body.onboarding-active .window:not(.onboarding-popup) {
  filter: blur(16px);
  transition: filter 0.35s ease;
  pointer-events: none;
}

.progsim-pause-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.progsim-pause-buttons .dialog-btn {
  width: 100%;
}

.progsim-start-btn {
  padding: 10px 32px;
  font-size: 15px;
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.progsim-option-label {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-bottom: -6px;
}

.progsim-full-width {
  width: 100%;
}

.progsim-bar-window {
  min-height: 0;
}

body.progsim-hide-icons #desktop-icons .desktop-icon:not(.progsim-pause-icon):not(.progsim-endgame-icon) {
  display: none;
}

body.progsim-paused #wallpaper-layer,
body.progsim-paused #desktop {
  filter: blur(16px);
  transition: filter 0.3s ease;
}

.progsim-overlay {
  position: fixed;
  top: var(--taskbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500000;
  pointer-events: none;
}

.progsim-bar {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 15px 16px;
}

.progsim-track {
  position: relative;
  width: 100%;
  height: 100%;
  background: #2b2b2b;
  border-radius: 10px;
  overflow: hidden;
}

.progsim-fill-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.progsim-fill-good {
  background: var(--color-accent);
}

.progsim-fill-risky {
  background: #ffb224;
}

.progsim-fill-minus {
  background: #d6409f;
}

.progsim-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.progsim-block {
  position: absolute;
  border-radius: 4px;
}

.progsim-block-good {
  background: var(--color-accent);
}

.progsim-block-risky {
  background: #ffb224;
}

.progsim-block-minus {
  background: #d6409f;
}

.progsim-block-danger {
  background: #e5484d;
  animation: progsimDangerPulse 0.45s ease-in-out infinite;
}

@keyframes progsimDangerPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.75); filter: brightness(1); }
  50% { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); filter: brightness(1.4); }
}

.progsim-block-risky::after,
.progsim-block-minus::after,
.progsim-block-danger::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1;
  color: rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.4);
}

.progsim-block-risky::after {
  content: "\25B3";
}

.progsim-block-minus::after {
  content: "\2212";
}

.progsim-block-danger::after {
  content: "!";
}

.progsim-result-swatch::after {
  content: none;
}

.progsim-start-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.progsim-start-row .progsim-start-btn {
  flex: 1;
}

.progsim-info-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-raised);
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.progsim-info-btn svg {
  width: 20px;
  height: 20px;
}

.progsim-info-btn:hover {
  border-color: var(--color-accent-dim);
  color: var(--color-accent);
}

.progsim-legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.progsim-legend-swatch {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 44px;
  font-size: 20px;
}

.progsim-legend-label {
  font-size: 14px;
  color: var(--color-text);
  text-align: left;
}

.progsim-legend-hint {
  font-size: 15px;
  color: var(--color-text);
  text-align: center;
  margin-top: 4px;
}

.progsim-legend-bar {
  position: relative;
  width: 100%;
  height: 36px;
  background: #2b2b2b;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.progsim-result-heading {
  font-size: 26px;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
}

.progsim-result-subtext {
  font-size: 12px;
  color: var(--color-text-faint);
  text-align: center;
  opacity: 0.5;
  margin-top: -9px;
}

.progsim-result-legend {
  justify-content: center;
}

.progsim-credit {
  font-size: 11px;
  color: var(--color-text-faint);
  text-align: center;
}

.progsim-result-swatch {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

body.progsim-seizure {
  pointer-events: none;
}

.progsim-bar-window.progsim-shake {
  animation: progsimSeizure 0.08s linear infinite;
}

@keyframes progsimSeizure {
  0% { transform: translateY(0); }
  25% { transform: translateY(-6px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(6px); }
  100% { transform: translateY(0); }
}

.sn-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  --sn-sky-drift-duration: 70s;
  --sn-sky-hue-duration: 150s;
  --sn-cloud-color: 210, 205, 235;
}

.sn-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 45% at 22% 12%, rgba(155, 109, 255, 0.38), transparent 60%),
    radial-gradient(ellipse 55% 40% at 82% 8%, rgba(255, 110, 190, 0.24), transparent 58%),
    radial-gradient(ellipse 75% 55% at 50% 38%, rgba(80, 100, 220, 0.30), transparent 65%),
    radial-gradient(ellipse 50% 35% at 65% 65%, rgba(120, 80, 200, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 92%, rgba(255, 176, 110, 0.14), transparent 70%),
    linear-gradient(180deg, #07061a 0%, #120f30 30%, #241a4d 60%, #3a2160 88%, #4a2a5e 100%);
  background-size: 160% 160%, 150% 150%, 170% 170%, 140% 140%, 100% 100%, 100% 100%;
  background-position: 0% 0%, 100% 0%, 50% 40%, 30% 80%, 50% 100%, 0 0;
  animation:
    snSkyDrift var(--sn-sky-drift-duration) ease-in-out infinite alternate,
    snSkyHue var(--sn-sky-hue-duration) linear infinite;
}

@keyframes snSkyDrift {
  0%   { background-position: 0% 0%,   100% 0%,  46% 36%, 26% 78%, 50% 100%, 0 0; }
  50%  { background-position: 12% 8%,  88% 14%,  54% 44%, 34% 84%, 50% 100%, 0 0; }
  100% { background-position: 20% 14%, 78% 20%,  40% 30%, 30% 74%, 50% 100%, 0 0; }
}

@keyframes snSkyHue {
  0%, 100% { filter: hue-rotate(0deg) saturate(1); }
  50%      { filter: hue-rotate(16deg) saturate(1.08); }
}

.sn-stars {
  position: absolute;
  inset: 0;
}

.sn-star {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  animation-name: snTwinkle;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes snTwinkle {
  0%, 100% { opacity: var(--sn-min-opacity, 0.15); }
  50%      { opacity: var(--sn-max-opacity, 0.9); }
}

.sn-clouds {
  position: absolute;
  inset: 0;
}

.sn-cloud {
  position: absolute;
  filter: blur(14px);
  opacity: 0.5;
  animation-name: snDrift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.sn-scene.sn-paused .sn-star,
.sn-scene.sn-paused .sn-cloud,
.sn-scene.sn-paused .sn-building-light {
  animation-play-state: paused;
}

.sn-cloud span {
  position: absolute;
  border-radius: 50%;
  background: rgba(var(--sn-cloud-color), 0.8);
}

@keyframes snDrift {
  from { transform: translateX(-25vw); }
  to   { transform: translateX(125vw); }
}

@keyframes snDriftReverse {
  from { transform: translateX(125vw); }
  to   { transform: translateX(-25vw); }
}

.sn-skyline-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1600px;
  height: 900px;
  transform-origin: center center;
}

.sn-skyline {
  position: absolute;
  inset: 0;
}

.sn-skyline-layer {
  position: absolute;
  inset: 0;
}

.sn-building-rect {
  position: absolute;
  bottom: 0;
}

.sn-building-light {
  position: absolute;
  animation: snWindowFlicker linear infinite;
}

@keyframes snWindowFlicker {
  0%, 68% { opacity: 1; }
  70%, 92% { opacity: 0.08; }
  94%, 100% { opacity: 1; }
}

.sn-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 100%, rgba(0, 0, 0, 0.35), transparent 60%);
}
