/* Deepin Desktop Environment preview
   Layout: dde-dock (Fashion / Efficient) + dde-launcher + dde-file-manager
   Colors: Deepin dark theme accent ~#0082FA, Bloom icons */

:root {
  /* Deepin dark */
  --dde-bg: #1f1f1f;
  --dde-bg-elevated: #2c2c2c;
  --dde-bg-window: #252525;
  --dde-bg-sidebar: #2a2a2a;
  --dde-bg-titlebar: #2e2e2e;
  --dde-fg: #e6e6e6;
  --dde-fg-dim: #9a9a9a;
  --dde-fg-muted: #6e6e6e;
  --dde-accent: #0082fa;
  --dde-accent-hover: #2596ff;
  --dde-accent-soft: rgba(0, 130, 250, 0.18);
  --dde-hover: rgba(255, 255, 255, 0.08);
  --dde-hover-strong: rgba(255, 255, 255, 0.12);
  --dde-border: rgba(255, 255, 255, 0.08);
  --dde-separator: rgba(255, 255, 255, 0.1);
  --dde-danger: #e23c39;
  --dde-danger-hover: #ff5552;

  /* Dock */
  --dock-height-fashion: 68px;
  --dock-height-efficient: 40px;
  --dock-radius: 16px;
  --dock-bg: rgba(0, 0, 0, 0.55);
  --dock-blur: blur(40px) saturate(1.35);
  --dock-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --dock-margin: 12px;
  --dock-icon: 44px;
  --dock-icon-eff: 28px;

  /* Launcher */
  --launcher-cat-w: 180px;
  --launcher-bg: rgba(20, 20, 20, 0.72);

  /* File manager window */
  --fm-width: 920px;
  --fm-height: 580px;
  --fm-radius: 10px;
  --fm-shadow: 0 20px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35);

  --font: "Noto Sans", "Source Han Sans SC", "Segoe UI", system-ui, sans-serif;
  --transition-fast: 100ms ease;
  --transition: 160ms ease;
  --sym-filter: invert(1) brightness(1.12);
  --wallpaper: url("assets/wallpapers/organic-glass-dark.jpg");
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  color: var(--dde-fg);
  background: #0a0a0a;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

button:focus-visible {
  outline: 2px solid var(--dde-accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* Invert only dark monochrome glyphs (Adwaita/Budgie-style).
   Bloom panel status icons ship pre-colored white — do not invert those. */
img.sym {
  filter: var(--sym-filter);
}

img.sym.sym-light {
  filter: none;
}

/* ========== Desktop shell ========== */

.desktop {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

.wallpaper {
  position: absolute;
  inset: 0;
  background-image: var(--wallpaper);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.desktop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 0;
}

/* ========== Dock mode chooser ========== */

.dock-chooser {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.78);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--dde-border);
}

.dock-chooser-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dde-fg-dim);
}

.dock-chooser-options {
  display: flex;
  gap: 8px;
}

.dock-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  min-width: 72px;
  transition: background var(--transition-fast);
}

.dock-opt:hover {
  background: var(--dde-hover);
}

.dock-opt.active {
  background: var(--dde-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 130, 250, 0.45);
}

.dock-opt-name {
  font-size: 11px;
  color: var(--dde-fg-dim);
}

.dock-opt.active .dock-opt-name {
  color: var(--dde-accent-hover);
}

.dock-preview {
  position: relative;
  width: 52px;
  height: 34px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--dde-border);
  overflow: hidden;
}

.dp-bar {
  position: absolute;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px;
}

.dock-preview-fashion .dp-dock {
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 8px;
  border-radius: 4px;
}

.dock-preview-efficient .dp-full {
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-radius: 0;
}

/* ========== Desktop icons ========== */

.desktop-icons {
  position: absolute;
  top: 24px;
  left: 20px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100% - 120px);
}

.desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 88px;
  padding: 8px 6px;
  border-radius: 8px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  transition: background var(--transition-fast);
}

.desk-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.desk-icon:focus-visible {
  background: var(--dde-accent-soft);
  outline-color: #fff;
}

.desk-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.desk-icon span {
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ========== Dock ========== */

.dock {
  position: absolute;
  z-index: 40;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.dock-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--dock-bg);
  backdrop-filter: var(--dock-blur);
  -webkit-backdrop-filter: var(--dock-blur);
  box-shadow: var(--dock-shadow);
}

.dock-apps,
.dock-tray {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dock-sep {
  width: 1px;
  height: 60%;
  background: var(--dde-separator);
  margin: 0 4px;
  flex-shrink: 0;
}

.dock-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.dock-btn:hover {
  background: var(--dde-hover-strong);
}

.dock-btn:active {
  transform: scale(0.94);
}

.dock-btn img {
  width: var(--dock-icon);
  height: var(--dock-icon);
  object-fit: contain;
}

.dock-btn.running .dock-indicator,
.dock-btn.active .dock-indicator {
  opacity: 1;
}

.dock-indicator {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dde-accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: 0 0 6px var(--dde-accent);
}

.dock-tray-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition-fast);
  color: var(--dde-fg);
}

.dock-tray-btn:hover {
  background: var(--dde-hover-strong);
}

.dock-tray-btn img.sym {
  width: 18px;
  height: 18px;
  /* Bloom panel status SVGs are already white for dark docks */
  filter: none;
}

/* Power glyph is a dark Adwaita-style SVG — invert so it reads on the dock */
.dock-tray-btn#power-btn img.sym {
  filter: invert(1) brightness(1.15);
}

.dock-clock {
  width: auto;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  min-height: 32px;
  flex-shrink: 0;
}

/* Fashion dock — floating, centered */
.dock-fashion .dock {
  left: 0;
  right: 0;
  bottom: var(--dock-margin);
  height: var(--dock-height-fashion);
}

.dock-fashion .dock-inner {
  height: 100%;
  padding: 8px 12px;
  border-radius: var(--dock-radius);
  max-width: calc(100% - 48px);
}

.dock-fashion .dock-btn {
  width: 56px;
  height: 56px;
}

.dock-fashion .dock-tray-btn {
  width: 36px;
  height: 36px;
}

.dock-fashion .dock-clock {
  width: auto;
  height: 36px;
}

/* Efficient dock — full-width thin bar */
.dock-efficient .dock {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--dock-height-efficient);
}

.dock-efficient .dock-inner {
  width: 100%;
  height: 100%;
  padding: 0 6px;
  border-radius: 0;
  justify-content: flex-start;
  gap: 2px;
  background: rgba(20, 20, 20, 0.82);
  overflow: hidden;
}

.dock-efficient .dock-apps {
  flex: 0 0 auto;
  gap: 0;
  min-width: 0;
}

.dock-efficient .dock-tray {
  flex: 0 0 auto;
  gap: 0;
  margin-left: auto; /* pin tray to the right edge */
  min-width: 0;
}

.dock-efficient .dock-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  flex-shrink: 0;
}

.dock-efficient .dock-btn img {
  width: var(--dock-icon-eff);
  height: var(--dock-icon-eff);
}

.dock-efficient .dock-tray-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Clock must not share the fixed tray-icon width — that caused text overflow/overlap */
.dock-efficient .dock-tray-btn.dock-clock {
  width: auto;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
}

.dock-efficient .dock-tray-btn img.sym {
  width: 16px;
  height: 16px;
  filter: none;
}

.dock-efficient .dock-indicator {
  bottom: 1px;
  width: 4px;
  height: 4px;
}

.dock-efficient .dock-sep {
  height: 55%;
  margin: 0 6px;
  flex-shrink: 0;
}

/* ========== Launcher ========== */

.launcher {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.launcher-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
}

.launcher-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 88px;
}

.launcher-search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  flex-shrink: 0;
}

.launcher-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(480px, 100%);
  height: 42px;
  padding: 0 16px;
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.launcher-search-box:focus-within {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--dde-accent);
  box-shadow: 0 0 0 2px var(--dde-accent-soft);
}

.launcher-search-box img.sym {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.launcher-search {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--dde-fg);
  font: inherit;
  font-size: 15px;
}

.launcher-search::placeholder {
  color: var(--dde-fg-dim);
}

.launcher-body {
  flex: 1;
  display: flex;
  gap: 20px;
  min-height: 0;
}

.launcher-categories {
  width: var(--launcher-cat-w);
  flex-shrink: 0;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.launcher-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  text-align: left;
  color: var(--dde-fg);
  transition: background var(--transition-fast);
}

.launcher-cat:hover {
  background: var(--dde-hover);
}

.launcher-cat.selected {
  background: var(--dde-accent-soft);
  color: #fff;
}

.launcher-cat img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.launcher-cat .cat-glyph {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.9;
}

.launcher-cat span {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launcher-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 4px 8px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.launcher-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px 6px;
  align-content: start;
}

.launcher-apps.free-mode {
  /* same grid; free mode just hides categories */
}

.launcher-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border-radius: 12px;
  transition: background var(--transition-fast);
}

.launcher-app:hover {
  background: var(--dde-hover-strong);
}

.launcher-app:active {
  background: var(--dde-accent-soft);
}

.launcher-app img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}

.launcher-app-name {
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #f0f0f0;
}

.launcher-empty {
  text-align: center;
  color: var(--dde-fg-dim);
  margin-top: 48px;
  font-size: 14px;
}

.launcher-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
}

.launcher-mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: var(--dde-fg-dim);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.launcher-mode-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--dde-fg);
}

.launcher-mode-btn.active {
  background: var(--dde-accent-soft);
  border-color: rgba(0, 130, 250, 0.4);
  color: #fff;
}

.launcher-mode-btn img.sym {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.free-mode-glyph {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* free mode hides category sidebar */
.launcher.mode-free .launcher-categories {
  display: none;
}

/* ========== Power dialog ========== */

.power-dialog {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.power-dialog-card {
  display: flex;
  gap: 16px;
  padding: 28px 32px;
  border-radius: 16px;
  background: rgba(40, 40, 40, 0.95);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--dde-border);
}

.power-dialog-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 88px;
  padding: 16px 8px;
  border-radius: 12px;
  transition: background var(--transition-fast);
}

.power-dialog-item:hover {
  background: var(--dde-hover-strong);
}

.power-dialog-item.danger:hover {
  background: rgba(226, 60, 57, 0.2);
  color: #ff8a87;
}

.power-dialog-item img.sym {
  width: 28px;
  height: 28px;
  /* Power icons are dark monochrome — invert to light */
  filter: invert(1) brightness(1.15);
}

.power-dialog-item span {
  font-size: 12px;
  font-weight: 500;
}

/* ========== Tray popovers ========== */

.tray-popover {
  position: absolute;
  z-index: 55;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(40, 40, 40, 0.94);
  backdrop-filter: blur(24px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--dde-border);
  bottom: calc(var(--dock-height-fashion) + var(--dock-margin) + 10px);
  right: max(24px, calc(50% - 420px));
}

.dock-efficient .tray-popover {
  bottom: calc(var(--dock-height-efficient) + 10px);
  right: 16px;
}

.tray-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--dde-fg-dim);
  margin-bottom: 10px;
}

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

.tray-row img.sym {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: none; /* Bloom status icons are white */
}

.tray-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--dde-accent);
  cursor: pointer;
}

.tray-pct {
  font-size: 12px;
  color: var(--dde-fg-dim);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tray-device {
  margin-top: 8px;
  font-size: 12px;
  color: var(--dde-fg-muted);
}

.tray-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tray-status-row img.sym {
  width: 22px;
  height: 22px;
  filter: none; /* Bloom status icons are white */
}

.tray-name {
  font-weight: 500;
  font-size: 13px;
}

.tray-sub {
  font-size: 12px;
  color: var(--dde-fg-dim);
  margin-top: 2px;
}

/* Calendar */
.calendar-popover {
  min-width: 280px;
  right: max(24px, calc(50% - 200px));
}

.cal-time {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.cal-date-line {
  font-size: 13px;
  color: var(--dde-accent-hover);
  margin: 4px 0 14px;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-month-label {
  font-weight: 600;
  font-size: 13px;
}

.cal-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 18px;
  color: var(--dde-fg-dim);
  transition: background var(--transition-fast);
}

.cal-nav-btn:hover {
  background: var(--dde-hover);
  color: var(--dde-fg);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--dde-fg-muted);
  margin-bottom: 4px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.cal-day.muted {
  color: var(--dde-fg-muted);
  opacity: 0.55;
}

.cal-day.today {
  background: var(--dde-accent);
  color: #fff;
  font-weight: 600;
}

/* Notification center */
.notif-center {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: calc(var(--dock-height-fashion) + var(--dock-margin) + 16px);
  width: min(360px, calc(100% - 32px));
  z-index: 55;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(35, 35, 35, 0.94);
  backdrop-filter: blur(28px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--dde-border);
  overflow: hidden;
}

.dock-efficient .notif-center {
  bottom: calc(var(--dock-height-efficient) + 16px);
}

.notif-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--dde-border);
  font-weight: 600;
  font-size: 14px;
}

.notif-clear-btn {
  font-size: 12px;
  color: var(--dde-accent-hover);
  padding: 4px 8px;
  border-radius: 6px;
}

.notif-clear-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.notif-clear-btn:not(:disabled):hover {
  background: var(--dde-accent-soft);
}

.notif-center-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--dde-fg-dim);
}

.notif-empty img.sym {
  width: 40px;
  height: 40px;
  opacity: 0.5;
  filter: none; /* Bloom notification icon is white */
}

.notif-empty p {
  margin: 0;
  font-size: 13px;
}

/* ========== File Manager (dde-file-manager) ========== */

.fm-window {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: var(--fm-width);
  height: var(--fm-height);
  max-width: calc(100% - 48px);
  max-height: calc(100% - 120px);
  display: flex;
  flex-direction: column;
  border-radius: var(--fm-radius);
  background: var(--dde-bg-window);
  box-shadow: var(--fm-shadow);
  overflow: hidden;
  color: var(--dde-fg);
}

.fm-window.maximized {
  left: 0;
  top: 0;
  right: 0;
  bottom: calc(var(--dock-height-fashion) + var(--dock-margin));
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  transform: none;
  border-radius: 0;
}

.dock-efficient .fm-window.maximized {
  bottom: var(--dock-height-efficient);
}

.fm-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 8px 0 12px;
  background: var(--dde-bg-titlebar);
  border-bottom: 1px solid var(--dde-border);
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.fm-titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fm-title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.fm-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}

.fm-wc {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}

.fm-wc:hover {
  filter: brightness(1.15);
  transform: scale(1.08);
}

.fm-min {
  background: #f4bf4f;
}

.fm-max {
  background: #61c554;
}

.fm-close {
  background: #ed6a5e;
}

.fm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--dde-bg-elevated);
  border-bottom: 1px solid var(--dde-border);
  flex-shrink: 0;
}

.fm-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.fm-tb-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.fm-tb-btn:hover:not(:disabled) {
  background: var(--dde-hover);
}

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

.fm-tb-btn.active {
  background: var(--dde-accent-soft);
}

.fm-tb-btn img.sym {
  width: 16px;
  height: 16px;
  /* Action glyphs use mid-gray fills — force light for dark window chrome */
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.fm-pathbar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--dde-border);
}

.fm-path-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.fm-path-label {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.fm-sidebar {
  width: 200px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 10px 8px;
  background: var(--dde-bg-sidebar);
  border-right: 1px solid var(--dde-border);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.fm-side-section {
  margin-bottom: 12px;
}

.fm-side-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--dde-fg-muted);
  padding: 4px 10px 6px;
}

.fm-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: left;
  transition: background var(--transition-fast);
}

.fm-side-item:hover {
  background: var(--dde-hover);
}

.fm-side-item.selected {
  background: var(--dde-accent-soft);
  color: #fff;
}

.fm-side-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.fm-side-item span {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--dde-bg-window);
}

.fm-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--dde-border);
  background: rgba(0, 0, 0, 0.15);
}

.fm-search-bar img.sym {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  filter: brightness(0) invert(1);
}

.fm-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--dde-fg);
  font: inherit;
  font-size: 13px;
}

.fm-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.fm-content.view-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  align-content: start;
}

.fm-content.view-icons .fm-list-header {
  display: none;
}

.fm-content.view-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.fm-list-header {
  display: none;
}

.fm-content.view-list .fm-list-header {
  display: grid;
  grid-template-columns: 36px 1fr 90px 120px;
  gap: 8px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--dde-fg-muted);
  border-bottom: 1px solid var(--dde-border);
  position: sticky;
  top: 0;
  background: var(--dde-bg-window);
  z-index: 1;
}

.fm-item {
  border-radius: 8px;
  transition: background var(--transition-fast);
  cursor: default;
}

.fm-item:hover,
.fm-item.selected {
  background: var(--dde-hover);
}

.fm-item.selected {
  background: var(--dde-accent-soft);
}

.fm-content.view-icons .fm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
}

.fm-content.view-icons .fm-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.fm-content.view-icons .fm-item-name {
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.fm-content.view-icons .fm-item-meta {
  display: none;
}

.fm-content.view-list .fm-item {
  display: grid;
  grid-template-columns: 36px 1fr 90px 120px;
  gap: 8px;
  align-items: center;
  padding: 6px 16px;
  border-radius: 0;
}

.fm-content.view-list .fm-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.fm-content.view-list .fm-item-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-content.view-list .fm-item-meta {
  font-size: 12px;
  color: var(--dde-fg-dim);
  white-space: nowrap;
}

.fm-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 14px;
  font-size: 12px;
  color: var(--dde-fg-dim);
  border-top: 1px solid var(--dde-border);
  background: var(--dde-bg-elevated);
  flex-shrink: 0;
}

/* ========== Responsive tweaks ========== */

@media (max-width: 900px) {
  .launcher-shell {
    padding: 32px 16px 80px;
  }

  .launcher-categories {
    width: 150px;
  }

  .fm-window {
    width: calc(100% - 24px);
    height: calc(100% - 100px);
  }

  .fm-sidebar {
    width: 160px;
  }

  .dock-fashion .dock-btn {
    width: 48px;
    height: 48px;
  }

  .dock-fashion .dock-btn img {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 640px) {
  .launcher-body {
    flex-direction: column;
  }

  .launcher-categories {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
  }

  .launcher-cat {
    flex-shrink: 0;
    width: auto;
  }

  .launcher-cat span {
    display: none;
  }

  .dock-chooser {
    top: 8px;
    right: 8px;
    transform: scale(0.9);
    transform-origin: top right;
  }

  .desktop-icons {
    top: 12px;
    left: 8px;
  }
}
