/* 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);

  /* one corner size for the whole OS - every rounded rectangle uses this */
  --radius: 6px;
  --taskbar-height: 34px;

  --dock-reserve-height: 0px;
  --dock-float-gap: 14px;
  --dock-icon-size: 40px;

  --titlebar-height: 38px;

  --window-bg-opacity: 70%;

  /* Panels drawn inside a glass window. Apps reference these instead of the
     solid --color-surface-* tokens so nothing has to be re-hardcoded when the
     window material changes. */
  --panel-bg: color-mix(in srgb, var(--color-surface-alt) 52%, transparent);
  --panel-bg-raised: color-mix(in srgb, var(--color-surface-raised) 58%, transparent);
  --panel-bg-deep: color-mix(in srgb, var(--color-surface) 62%, transparent);

  --color-icon: #9c9ca6;

  --tes-red: #e5484d;
}

* {
  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;
}

#photosensitive-screen {
  position: fixed;
  inset: 0;
  z-index: 1500000;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-family: var(--font-ui);
  padding: 24px;
  transition: opacity 0.4s ease;
}

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

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

.photosensitive-icon {
  width: clamp(64px, 10vw, 96px);
  height: clamp(64px, 10vw, 96px);
  margin-bottom: 28px;
}

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

.photosensitive-heading {
  max-width: min(720px, 90vw);
  font-size: clamp(17px, 2.4vw, 26px);
  font-weight: 500;
}

.photosensitive-delayed {
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: hidden;
}

.photosensitive-delayed.revealed {
  visibility: visible;
}

.photosensitive-toggle-row {
  margin-top: 48px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600;
}

.photosensitive-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: default;
}

.photosensitive-subtext-faint {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}

.photosensitive-proceed-btn {
  margin-top: 48px;
}

#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 {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: clamp(8px, 2.6vw, 18px);
  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: var(--radius);
  box-sizing: border-box;
  overflow: hidden;
}

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

.loading-postcrash-subtext {
  margin-top: -6px;
  font-size: 13px;
  color: var(--color-text-dim);
  text-align: center;
}

.loading-postcrash-subtext.hidden {
  display: none;
}

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

.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 {
  display: none;
  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);
  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); }
}

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

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

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

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

.gameover-btn-row {
  position: absolute;
  left: 50%;
  top: calc(50% + 32px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

#gameover-screen .crash-okay-btn {
  display: none;
}

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

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

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

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

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

#crash-screen {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  overflow: hidden;
  font-family: var(--font-ui);
}

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

.crash-veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
}

#crash-screen.blank .crash-veil {
  background: #000000;
  transform: scaleY(1);
  transition: none;
}

#crash-screen.blank .crash-dialog {
  visibility: hidden;
}

.crash-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  width: min(420px, 88vw);
  background: var(--color-surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.crash-dialog.visible {
  opacity: 1;
  pointer-events: auto;
}

.crash-dialog-header {
  font-size: 32px;
  font-weight: 700;
  white-space: nowrap;
}

.crash-dialog-subtext {
  margin-top: 14px;
  font-size: 15px;
  color: var(--color-text-dim);
}

.crash-dialog-subtext-faint {
  margin-top: 2px;
  font-size: 13px;
  color: var(--color-text-faint);
}

.crash-power-btn {
  width: 88px;
  height: 88px;
  margin-top: 26px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
  touch-action: none;
  transition: transform 0.12s ease;
}

.crash-power-btn svg {
  width: 44px;
  height: 44px;
}

.crash-power-btn.held {
  transform: scale(0.94);
}

.crash-power-progress-wrap {
  margin-top: 18px;
  width: min(220px, 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

.crash-power-progress-wrap .loading-progress-track {
  width: 100%;
}

.crash-power-progress-wrap.held {
  opacity: 1;
  visibility: visible;
}

.crash-footer {
  margin-top: 22px;
  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);
}

#tes-toast-layer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.tes-toast {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 18px;
  white-space: nowrap;
  transform: translateX(120%);
  opacity: 0;
}

.tes-toast.visible {
  transform: translateX(0);
  opacity: 1;
}

#tes-screen {
  position: fixed;
  inset: 0;
  z-index: 1000001;
  background: #000000;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  overflow: hidden;
}

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

#tes-screen.visible {
  opacity: 1;
}

.tes-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
}

.tes-stack.flicker-in {
  animation: tesFlickerIn 0.8s steps(1) forwards;
}

.tes-dialog {
  position: relative;
  width: min(600px, 92vw);
  height: min(680px, 90vh);
  display: flex;
  flex-direction: column;
  border: 1px solid #ffffff;
  background: #000000;
  color: #ffffff;
}

.tes-ip-window {
  width: min(600px, 92vw);
  border: 1px solid #ffffff;
  background: #000000;
  color: #ffffff;
  padding: 14px 20px;
  font-size: 14px;
}

.tes-ip-window.hidden {
  display: none;
}

.tes-ip-text {
  color: var(--tes-red);
  font-weight: 700;
}

#tes-red-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: rgba(229, 72, 77, 0.25);
  pointer-events: none;
}

#tes-red-overlay::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--tes-red);
}

@keyframes tesFlickerIn {
  0% { opacity: 0; }
  10% { opacity: 1; }
  18% { opacity: 0; }
  28% { opacity: 1; }
  36% { opacity: 0.2; }
  46% { opacity: 1; }
  60% { opacity: 0.5; }
  75% { opacity: 1; }
  100% { opacity: 1; }
}

.tes-header {
  padding: 10px 16px;
  border-bottom: 1px solid #ffffff;
  font-size: 13px;
}

.tes-body {
  padding: 24px;
}

.tes-title {
  color: var(--tes-red);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.tes-instructions {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.tes-instructions .term-accent {
  font-weight: 600;
}

.tes-progress-track {
  position: relative;
  height: 40px;
  border: 1px solid var(--tes-red);
  background: #000000;
  overflow: hidden;
}

.tes-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  overflow: hidden;
  background: var(--tes-red);
}

.tes-progress-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.tes-progress-label-black {
  right: auto;
  color: #000000;
}

.tes-terminal-wrap {
  flex: 1;
  min-height: 180px;
  border-top: 1px solid #ffffff;
}

.tes-terminal-wrap .terminal {
  height: 100%;
}

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);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
  border: 1px solid transparent;
}

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

@media (hover: hover) and (pointer: fine) {
  .desktop-icon:hover {
    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: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: default;
  transition: background 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  #start-button:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}

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

.start-button-ring {
  width: 19px;
  height: 19px;
  border-radius: var(--radius);
  border: 2px solid currentColor;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.start-button-fill {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--color-accent);
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  #start-button:hover .start-button-ring {
    border-color: var(--color-accent);
  }
}

#start-button.active .start-button-ring {
  width: 25px;
  height: 25px;
  border-color: var(--color-accent);
}

#start-button.active .start-button-fill {
  transform: scale(1);
}

#start-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(420px, 92vw);
  height: min(600px, 86vh);
  height: min(600px, 86dvh);
  background: color-mix(in srgb, var(--color-surface) var(--window-bg-opacity), transparent);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  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;
}

#desktop::after,
#taskbar::after,
#window-layer::after,
.window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.dock-open #desktop::after,
body.dock-open #window-layer::after {
  opacity: 1;
}

.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);
  border: none;
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--panel-bg-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .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-search {
  flex: 0 0 auto;
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  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);
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .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-clock {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #ffffff;
  user-select: none;
}

#taskbar-clock-time {
  font-weight: 600;
  /* scales with the bar itself instead of a fixed px, so it still fits
     snugly if --taskbar-height ever changes (e.g. the coarse-pointer bump) */
  font-size: calc(var(--taskbar-height) * 0.4);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

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

.show-desktop-btn[data-state="hollow"] {
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .show-desktop-btn[data-state="filled"]:hover {
    background: var(--color-accent-dim);
  }

  .show-desktop-btn[data-state="hollow"]:hover {
    background: var(--color-accent-soft);
  }
}

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

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

#start-button,
#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-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;
}

/* ---------- floating dock ---------- */

#dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--dock-float-gap);
  z-index: 9000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: bottom 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.26s ease;
}

#dock-shell {
  pointer-events: auto;
  display: flex;
  align-items: center;
  max-width: calc(100vw - 20px);
  padding: 8px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: opacity 0.26s ease,
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              border-radius 0.28s ease,
              padding 0.28s ease;
}

#dock-items {
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
  scrollbar-width: none;
}

#dock-items::-webkit-scrollbar {
  display: none;
}

/* Only scrolls once the icons genuinely don't fit. overflow-x forces
   overflow-y to compute as auto, which would clip the hover magnification, so
   Dock.js turns magnification off while this is on - the two can't coexist. */
#dock[data-overflow="true"] #dock-items {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.dock-scroll-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: var(--dock-icon-size);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-dim);
  cursor: default;
  transition: color 0.12s ease;
}

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

.dock-scroll-btn[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .dock-scroll-btn:hover {
    color: var(--color-text);
  }
}

/* no open apps - the pill collapses away entirely rather than sitting empty */
#dock[data-state="empty"] #dock-shell {
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
}

/* width/margin animate so neighbours close the gap instead of the icon
   popping a hole in the row; transform+opacity carry the actual slide */
.dock-item {
  position: relative;
  flex: 0 0 auto;
  width: var(--dock-icon-size);
  height: var(--dock-icon-size);
  margin: 0 4px;
  transition: opacity 0.26s ease,
              transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              margin 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-item.dock-item-enter,
.dock-item.dock-item-exit {
  opacity: 0;
  transform: translateY(24px);
  width: 0;
  margin-left: 0;
  margin-right: 0;
  pointer-events: none;
}

/* the layer JS writes magnification into - kept separate from the enter/exit
   transform above so the two never fight over the same property */
.dock-item-mag {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.dock-item-btn {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: default;
}

.dock-item-btn .icon-glyph {
  display: block;
  width: 74%;
  height: 74%;
  transition: color 0.15s ease, opacity 0.2s ease;
}

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

.dock-item[data-state="active"] .dock-item-btn .icon-glyph {
  color: var(--color-accent);
}

.dock-item[data-minimized="true"] .dock-item-btn .icon-glyph {
  opacity: 0.45;
}

/* running indicator sits outside .dock-item-mag so it stays put while the
   icon above it scales and lifts */
.dock-item-indicator {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(-50%);
  transition: width 0.2s ease, border-radius 0.2s ease, background 0.2s ease;
}

.dock-item[data-state="active"] .dock-item-indicator {
  background: var(--color-accent);
}

.dock-item[data-multi="true"] .dock-item-indicator {
  width: 14px;
  border-radius: 2px;
}

/* one entry per open window, fanning upward out of the icon */
.dock-fan {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 9001;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
}

.dock-item[data-fan="open"] .dock-fan {
  pointer-events: auto;
}

/* invisible bridge across the icon-to-fan gap - without it the pointer leaves
   .dock-item on the way up and a hover-opened fan snaps shut. Only hit-testable
   while the fan is open, since .dock-fan is pointer-events:none otherwise. */
.dock-fan::before {
  content: "";
  position: absolute;
  left: -16px;
  right: -16px;
  bottom: -18px;
  height: 20px;
}

.dock-fan-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  padding: 6px 12px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
  opacity: 0;
  transform: translateY(16px) scale(0.86);
  transition: opacity 0.2s ease,
              transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.14s ease,
              background 0.14s ease;
}

.dock-item[data-fan="open"] .dock-fan-entry {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: calc(var(--fan-index, 0) * 40ms);
}

.dock-fan-entry .icon-glyph {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--color-text-dim);
}

.dock-fan-entry .icon-glyph svg {
  width: 100%;
  height: 100%;
}

.dock-fan-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-fan-entry[data-state="active"] {
  border-color: var(--color-accent);
}

.dock-fan-entry[data-state="active"] .icon-glyph {
  color: var(--color-accent);
}

@media (hover: hover) and (pointer: fine) {
  .dock-fan-entry:hover {
    background: rgba(40, 40, 50, 0.92);
    border-color: var(--color-accent);
  }
}

/* a maximized window pulls the dock flush to the bottom edge - it stops
   floating until the window is restored */
body.dock-anchored #dock {
  bottom: 0;
}

body.dock-anchored #dock-shell {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom-color: transparent;
  padding-bottom: 10px;
}

/* slides fully off-screen for the Progress Simulator run, and while the
   desktop is being shown */
body.dock-hidden #dock,
body.show-desktop-active #dock {
  transform: translateY(calc(100% + var(--dock-float-gap) + 14px));
  opacity: 0;
  pointer-events: none;
}

body.dock-open #dock-shell {
  opacity: 0.45;
}

@media (max-width: 600px) {
  :root {
    --dock-icon-size: 34px;
    --dock-float-gap: 10px;
  }

  .dock-item {
    margin: 0 3px;
  }

  .dock-fan-entry {
    max-width: 170px;
    font-size: 12px;
  }
}

#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);
  /* the blur is what makes the translucency read as glass rather than as a
     window someone forgot to make opaque */
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  /* with the drop shadow gone the outline is what separates a window from the
     wallpaper, so it is no longer optional */
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-radius 0.18s ease, border-color 0.15s ease;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  /* Dock.js keeps --dock-reserve-height in sync with the pill's real height so
     a maximized window ends above it rather than running underneath */
  height: calc(100% - var(--dock-reserve-height, 0px)) !important;
}

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

.window.animating {
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1), left 0.2s cubic-bezier(0.16, 1, 0.3, 1), width 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.window.minimizing {
  animation: windowFadeOut 0.2s ease forwards;
  pointer-events: none;
}

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

.window.maximized.closing {
  animation: windowFadeOut 0.2s ease forwards;
}

.window.opening {
  animation: windowOpen 0.2s ease forwards;
  pointer-events: none;
}

body.storm-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 { transform: scale(0.94); }
  to { transform: scale(1); }
}

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

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

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

.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(--panel-bg);
  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: var(--radius);
  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.extra {
  margin-right: 12px;
}

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

@media (hover: hover) and (pointer: fine) {
  .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:hover {
    background: var(--color-white-soft);
  }
}

.window .content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: 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: var(--radius);
  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: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--panel-bg-raised);
  color: var(--color-text);
  font-size: 14px;
  cursor: default;
}

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

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

@media (hover: hover) and (pointer: fine) {
  .dialog-btn:hover {
    border-color: var(--color-accent-dim);
    color: var(--color-accent);
  }

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

  .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: var(--radius);
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

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

@media (hover: hover) and (pointer: fine) {
  .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(--panel-bg);
  border-radius: var(--radius);
}

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

@media (hover: hover) and (pointer: fine) {
  .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: var(--panel-bg);
  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: var(--radius);
  font-size: 14px;
  color: var(--color-text-dim);
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
  .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);
  cursor: default;
  border: 1px solid transparent;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  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-main.fm-drop-active {
  outline: 2px dashed var(--color-accent);
  outline-offset: -8px;
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}

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

.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;
}

.text-glitch-block {
  position: relative;
  display: inline-block;
  width: 1ch;
  overflow: hidden;
  text-align: center;
  animation: textGlitchBlock 0.4s steps(1, jump-end) infinite;
}

@keyframes textGlitchBlock {
  0% { color: var(--color-text); text-shadow: none; transform: translate(0, 0); clip-path: inset(0 0 0 0); filter: none; }
  25% { color: var(--glitch-color-a, #ff0000); text-shadow: var(--glitch-glow-a, 0 0 3px rgba(255, 0, 0, 0.8)); transform: translate(var(--glitch-jx1, -1px), var(--glitch-jy1, 1px)); clip-path: inset(10% 0 60% 0); filter: hue-rotate(40deg); }
  50% { color: var(--glitch-color-b, #3ec6e0); text-shadow: var(--glitch-glow-b, 0 0 3px rgba(62, 198, 224, 0.7)); transform: translate(var(--glitch-jx2, 1px), var(--glitch-jy2, -1px)); clip-path: inset(0 0 0 0); filter: none; }
  75% { color: var(--glitch-color-a, #ff0000); text-shadow: var(--glitch-glow-a, 0 0 3px rgba(255, 0, 0, 0.8)); transform: translate(var(--glitch-jx3, -1px), var(--glitch-jy3, -1px)); clip-path: inset(60% 0 5% 0); filter: hue-rotate(-40deg); }
  100% { color: var(--color-text); text-shadow: none; transform: translate(0, 0); clip-path: inset(0 0 0 0); filter: none; }
}

.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: var(--radius);
}

.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;
}

.term-accent {
  color: var(--color-accent);
}

.term-error {
  color: var(--tes-red);
}

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

.terminal-prompt {
  color: var(--color-accent);
  font-weight: 700;
  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: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--panel-bg-raised);
  color: var(--color-text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .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(--panel-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  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(--panel-bg-deep) 0deg);
  -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 59%);
  mask: radial-gradient(circle, transparent 0 58%, #000 59%);
}

.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(--panel-bg-deep);
  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: var(--radius);
  background: var(--panel-bg);
  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;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  cursor: default;
}

.custom-select-trigger.open {
  border-color: var(--color-accent-dim);
}

@media (hover: hover) and (pointer: fine) {
  .custom-select-trigger:hover {
    border-color: var(--color-accent-dim);
  }
}

.custom-select-trigger-arrow {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--color-text);
  border-bottom: 1.5px solid var(--color-text);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.custom-select-trigger.open .custom-select-trigger-arrow {
  transform: rotate(-135deg);
  margin-top: 3px;
}

.custom-select-menu {
  position: fixed;
  z-index: 10060;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.custom-select-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .custom-select-option:hover {
    background: var(--color-surface-alt);
  }
}

.custom-select-option.selected {
  color: var(--color-accent);
}

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

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  border: 1px solid var(--color-border);
  flex: 0 0 auto;
}

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

@media (hover: hover) and (pointer: fine) {
  .wallpaper-pick-btn:hover {
    border-color: var(--color-accent-dim);
    color: var(--color-accent);
  }
}

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

@media (hover: hover) and (pointer: fine) {
  .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(--panel-bg);
  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(18px);
  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);
  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: var(--radius);
  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: var(--radius);
  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: var(--radius);
  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(--panel-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  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: var(--radius);
  border: 1px solid var(--color-border);
  padding: 0;
  cursor: default;
  transition: transform 0.1s ease;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--panel-bg-raised);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .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;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--panel-bg-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(--panel-bg-raised);
  border: none;
  border-radius: var(--radius);
  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);
  background: var(--panel-bg-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;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  background: transparent;
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex: 0 0 auto;
}

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  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);
  }

  .custom-select-trigger,
  .custom-select-option {
    font-size: 15px;
  }
}

body.desktop-blur-active #desktop::after,
body.desktop-blur-active #taskbar::after {
  opacity: 1;
}

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

body.onboarding-active .window:not(.onboarding-popup) {
  pointer-events: none;
}

body.onboarding-active .window:not(.onboarding-popup)::after {
  opacity: 1;
}

.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 #desktop::after {
  opacity: 1;
}

.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: var(--radius);
  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: var(--radius);
}

.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: translateY(var(--fall-y, 0px)) scale(1); box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.75); filter: brightness(1); }
  50% { transform: translateY(var(--fall-y, 0px)) 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: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--panel-bg-raised);
  color: var(--color-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

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

@media (hover: hover) and (pointer: fine) {
  .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: var(--radius);
  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%);
}

.tw-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-clip-path: inset(0);
  clip-path: inset(0);
  pointer-events: none;
  font-family: "IBM Plex Mono", "Menlo", "Consolas", monospace;
  -webkit-perspective: 1800px;
  perspective: 1800px;
  perspective-origin: 0% 50%;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0px, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0px, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 48px),
    #000000;
}

.tw-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-clip-path: inset(0);
  clip-path: inset(0);
  padding: 8vh max(28px, 3vw) 4vh max(20px, 3vw);
  -webkit-transform: rotateY(22deg) translateZ(0);
  transform: rotateY(22deg) translateZ(0);
  transform-origin: left center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.tw-content {
  will-change: transform;
}

.tw-line {
  font-size: clamp(13px, 1.6vw, 18px);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

@media (max-width: 720px) {
  .tw-viewport {
    padding: 6vh 18px 4vh 18px;
  }
}

.tw-line.tw-glitching {
  animation: twGlitch 0.25s steps(4) 1;
}

@keyframes twGlitch {
  0% { transform: translateX(0); opacity: 1; }
  20% { transform: translateX(-3px); opacity: 0.65; }
  40% { transform: translateX(3px); opacity: 0.9; }
  60% { transform: translateX(-2px); opacity: 0.6; }
  80% { transform: translateX(1px); opacity: 0.85; }
  100% { transform: translateX(0); opacity: 1; }
}

.tw-seg-accent {
  color: var(--color-accent);
  text-shadow: 0 0 6px currentColor;
}

.tw-seg-base {
  color: #e6e6e6;
}

.tw-seg-dim {
  color: #8f8f8f;
}

.tw-cursor {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
  vertical-align: -0.15em;
  margin-left: 2px;
  animation: twBlink 1s steps(2, jump-none) infinite;
}

@keyframes twBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.tw-fade-right {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, transparent 48%, rgba(0, 0, 0, 0.65) 100%);
}

.tw-fade-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10vh;
  background: linear-gradient(180deg, #000000 0%, transparent 100%);
}
