/* Unity Desktop Preview
   Defaults from: Unity 7 shell (upstream layout) — unbranded, no distro skin
   Panel: top 24px — global menu + indicators
   Launcher: left dock — BFB, favorites, workspace switcher, trash
   Theme: neutral dark panel/launcher, light window content, left window buttons
   Icons: freedesktop-style; wallpaper: non-distro default scene
*/

:root {
  /* Shell chrome */
  --shell-bg: #3c3b37;
  --shell-bg-dark: #2b2a26;
  --shell-bg-mid: #4e4d47;
  --shell-bg-light: #5e5d58;
  --shell-fg: #ffffff;
  --shell-fg-dim: rgba(255, 255, 255, 0.75);
  --shell-fg-muted: rgba(255, 255, 255, 0.55);
  /* Neutral accent (not distro brand orange) */
  --accent: #398ee7;
  --accent-hover: #5aa3f0;
  --accent-soft: rgba(57, 142, 231, 0.22);
  --close-btn: #df382c;
  --close-btn-hover: #f05045;
  --selection: #398ee7;
  --selection-fg: #ffffff;

  /* Surfaces (light window content) */
  --window-bg: #f5f4f2;
  --window-fg: #3c3b37;
  --window-fg-dim: #6a6964;
  --sidebar-bg: #edebe7;
  --sidebar-hover: rgba(0, 0, 0, 0.06);
  --sidebar-selected: #398ee7;
  --sidebar-selected-fg: #fff;
  --toolbar-bg: #f0eeea;
  --entry-bg: #ffffff;
  --entry-border: #c0bfba;
  --border: #c8c6c0;
  --border-dark: rgba(0, 0, 0, 0.2);
  --list-alt: #faf9f7;
  --list-hover: #e8e6e1;
  --list-selected: #398ee7;
  --list-selected-fg: #fff;

  /* Chrome */
  --panel-height: 24px;
  --panel-bg: rgba(60, 59, 55, 0.92);
  --launcher-width: 64px;
  --launcher-bg: rgba(43, 42, 38, 0.88);
  --launcher-icon: 48px;
  --titlebar-height: 28px;
  --titlebar-bg: linear-gradient(to bottom, #59564f 0%, #3c3b37 100%);
  --titlebar-fg: #ffffff;

  --shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --font: "Noto Sans", system-ui, sans-serif;
  --font-mono: "Noto Sans Mono", "DejaVu Sans Mono", monospace;
  --transition: 140ms ease-out;
  --sym-filter: invert(1) brightness(1.1);
  --wallpaper: url("assets/wallpapers/default.jpg");

  --dash-bg: rgba(40, 38, 34, 0.82);
  --popover-bg: #3c3b37;
  --popover-fg: #ffffff;
  --popover-border: rgba(255, 255, 255, 0.1);

  --chrome-top: var(--panel-height);
  --chrome-left: var(--launcher-width);
  --chrome-bottom: 0px;
  --chrome-right: 0px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 13px;
  color: var(--shell-fg);
  background: #1a1917;
  user-select: none;
  -webkit-user-select: none;
}

button,
input {
  font-family: inherit;
}

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

img {
  display: block;
  max-width: 100%;
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

.sym {
  width: 16px;
  height: 16px;
  filter: var(--sym-filter);
  flex-shrink: 0;
}

/* ---------- Desktop ---------- */

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

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

.desktop-icons {
  position: absolute;
  top: calc(var(--panel-height) + 16px);
  left: calc(var(--launcher-width) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
}

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

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

.desk-icon span {
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}

.desk-icon:hover,
.desk-icon:focus-visible,
.desk-icon.selected {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.desk-icon:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

/* ---------- Top panel ---------- */

.top-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--panel-height);
  background: var(--panel-bg);
  backdrop-filter: blur(12px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 8px;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-start {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
  height: 100%;
}

.appmenu-btn {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  font-weight: 500;
  font-size: 13px;
  border-radius: 3px;
  color: var(--shell-fg);
}

.appmenu-btn:hover,
.appmenu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.appmenu-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.global-menu {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

.gmenu-item {
  height: 100%;
  padding: 0 8px;
  font-size: 13px;
  color: var(--shell-fg-dim);
  border-radius: 3px;
}

.gmenu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--shell-fg);
}

.panel-end {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  flex-shrink: 0;
}

.indicator-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 100%;
  min-width: 28px;
  padding: 0 7px;
  border-radius: 3px;
  color: var(--shell-fg);
  font-size: 12px;
}

.indicator-btn:hover,
.indicator-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
}

.datetime-btn {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.session-btn .session-label {
  font-size: 12px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Launcher ---------- */

.launcher {
  position: absolute;
  top: var(--panel-height);
  left: 0;
  bottom: 0;
  width: var(--launcher-width);
  background: var(--launcher-bg);
  backdrop-filter: blur(18px) saturate(1.15);
  display: flex;
  flex-direction: column;
  z-index: 90;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04);
}

.launcher-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.launcher-scroll::-webkit-scrollbar {
  display: none;
}

.launcher-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.launcher-btn {
  position: relative;
  width: 56px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition);
}

.launcher-btn img {
  width: var(--launcher-icon);
  height: var(--launcher-icon);
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: transform 120ms ease;
}

.launcher-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.launcher-btn:hover img {
  transform: scale(1.06);
}

.launcher-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.launcher-btn.running .running-pip,
.launcher-btn.active .running-pip {
  opacity: 1;
}

.launcher-btn.active {
  background: rgba(255, 255, 255, 0.12);
}

.running-pip {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 8px;
  border-radius: 0 2px 2px 0;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
  opacity: 0;
  transition: opacity var(--transition);
}

.launcher-btn.bfb {
  margin-bottom: 2px;
}

.launcher-btn.bfb img.bfb-logo {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.launcher-btn.bfb[aria-expanded="true"],
.launcher-btn.bfb:hover {
  background: rgba(57, 142, 231, 0.3);
}

/* ---------- Dash ---------- */

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

.dash-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(22px) saturate(1.1);
}

.dash-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--panel-height) + 28px) 0 0 var(--launcher-width);
  min-height: 0;
}

.dash-search-wrap {
  display: flex;
  justify-content: center;
  padding: 0 24px 20px;
}

.dash-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 90%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.dash-search-box .sym {
  opacity: 0.85;
}

.dash-search {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  outline: none;
  min-width: 0;
}

.dash-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.dash-body {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 0 28px 12px;
  gap: 20px;
}

.dash-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-right: 8px;
}

.dash-section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.dash-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px 6px;
  max-width: 920px;
}

.dash-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 8px;
  color: #fff;
  transition: background var(--transition);
}

.dash-app:hover,
.dash-app:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.dash-app img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.dash-app span {
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.dash-empty {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  margin: 32px 0;
  text-align: center;
}

.dash-filters {
  width: 200px;
  flex-shrink: 0;
  padding: 4px 0 16px 8px;
  overflow-y: auto;
}

.filter-heading {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  padding-left: 8px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.filter-item {
  text-align: left;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.filter-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

.dash-lenses {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 18px;
}

.lens-btn {
  width: 44px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0.65;
}

.lens-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.lens-btn.active {
  background: rgba(255, 255, 255, 0.14);
  opacity: 1;
}

.lens-btn .sym {
  width: 18px;
  height: 18px;
}

/* ---------- Popovers ---------- */

.popover {
  position: absolute;
  z-index: 150;
  min-width: 240px;
  max-width: 300px;
  background: var(--popover-bg);
  color: var(--popover-fg);
  border: 1px solid var(--popover-border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  top: calc(var(--panel-height) + 4px);
  right: 8px;
}

.popover-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--shell-fg-muted);
  padding: 4px 14px 8px;
}

.popover-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 10px;
}

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

.popover-sub {
  font-size: 12px;
  color: var(--shell-fg-muted);
  margin-top: 2px;
}

.popover-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

.popover-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--shell-fg-dim);
}

.popover-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--shell-fg);
}

.sound-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 8px;
}

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

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

.sound-device {
  padding: 0 14px 6px;
}

/* Calendar */
.calendar-popover {
  min-width: 280px;
  padding: 12px 14px 14px;
  right: 80px;
}

.cal-time {
  font-size: 28px;
  font-weight: 300;
  line-height: 1.1;
}

.cal-date {
  font-size: 13px;
  color: var(--shell-fg-dim);
  margin-bottom: 12px;
}

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

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

.cal-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--shell-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;
  font-size: 12px;
  border-radius: 50%;
  color: var(--shell-fg);
}

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

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

/* Session menu */
.session-popover {
  min-width: 220px;
  padding: 6px 0;
  right: 6px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
}

.session-item img:not(.sym) {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.session-item.danger:hover {
  background: rgba(223, 56, 44, 0.35);
}

.session-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

/* Session dialog */
.session-dialog {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.session-dialog-card {
  background: var(--window-bg);
  color: var(--window-fg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px 28px 18px;
  width: min(380px, 92vw);
  text-align: center;
  border: 1px solid var(--border);
}

.session-dialog-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 50%;
}

.session-dialog-icon .sym {
  width: 24px;
  height: 24px;
  filter: none;
  /* orange-ish on light */
  filter: invert(38%) sepia(78%) saturate(1800%) hue-rotate(346deg) brightness(95%);
}

.session-dialog-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
}

.session-dialog-msg {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--window-fg-dim);
  line-height: 1.4;
}

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

.btn {
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.btn-flat {
  color: var(--window-fg);
  background: transparent;
}

.btn-flat:hover {
  background: rgba(0, 0, 0, 0.06);
}

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

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

/* Workspace overlay */
.workspace-overlay {
  position: absolute;
  inset: 0;
  z-index: 180;
  background: rgba(20, 18, 16, 0.72);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: var(--launcher-width);
  padding-top: var(--panel-height);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 720px;
  width: 80%;
}

.ws-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.ws-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(233, 84, 32, 0.25), transparent 50%),
    url("assets/wallpapers/default.jpg") center / cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), transform var(--transition);
}

.ws-tile:hover .ws-preview,
.ws-tile.active .ws-preview {
  border-color: var(--accent);
  transform: scale(1.02);
}

.ws-num {
  font-size: 32px;
  font-weight: 300;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.ws-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Windows (Unity decorations) ---------- */

.window {
  position: absolute;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--window-bg);
  color: var(--window-fg);
  border-radius: 6px 6px 0 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.35);
  overflow: hidden;
  min-width: 420px;
  min-height: 280px;
}

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

.titlebar {
  height: var(--titlebar-height);
  background: var(--titlebar-bg);
  color: var(--titlebar-fg);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
  flex-shrink: 0;
  cursor: default;
}

.titlebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  min-width: 0;
  flex: 1;
  justify-content: center;
  pointer-events: none;
}

.titlebar-title img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.titlebar-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.titlebar-spacer {
  width: 70px;
  flex-shrink: 0;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 70px;
  flex-shrink: 0;
}

.wc {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  position: relative;
  flex-shrink: 0;
}

.wc.close {
  background: radial-gradient(circle at 30% 30%, #f47c73, var(--close-btn));
}

.wc.minimize {
  background: radial-gradient(circle at 30% 30%, #f0c96a, #c9a227);
}

.wc.maximize {
  background: radial-gradient(circle at 30% 30%, #8fd47a, #5a9e3f);
}

.wc:hover {
  filter: brightness(1.12);
}

.wc:active {
  filter: brightness(0.92);
}

/* icon glyphs on hover */
.wc::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 80ms;
}

.titlebar:hover .wc::after {
  opacity: 0.85;
}

.wc.close::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath stroke='%234a0a08' stroke-width='1.4' d='M1.5 1.5l5 5M6.5 1.5l-5 5'/%3E%3C/svg%3E") center / 8px no-repeat;
}

.wc.minimize::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath stroke='%234a3808' stroke-width='1.4' d='M1.5 4h5'/%3E%3C/svg%3E") center / 8px no-repeat;
}

.wc.maximize::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Crect x='1.5' y='1.5' width='5' height='5' fill='none' stroke='%231a3a0a' stroke-width='1.2'/%3E%3C/svg%3E") center / 8px no-repeat;
}

/* ---------- File manager ---------- */

.fm-window {
  top: 72px;
  left: 120px;
  width: min(860px, calc(100vw - var(--launcher-width) - 48px));
  height: min(560px, calc(100vh - var(--panel-height) - 48px));
}

.fm-window.maximized {
  top: var(--panel-height) !important;
  left: var(--launcher-width) !important;
  width: calc(100% - var(--launcher-width)) !important;
  height: calc(100% - var(--panel-height)) !important;
}

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

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

.fm-tb-btn {
  width: 30px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--window-fg);
}

.fm-tb-btn .sym {
  filter: none;
  opacity: 0.75;
}

.fm-tb-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.06);
}

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

.fm-tb-btn.active {
  background: rgba(0, 0, 0, 0.1);
}

.fm-tb-btn.active .sym {
  opacity: 1;
}

.fm-pathbar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  background: var(--entry-bg);
  border: 1px solid var(--entry-border);
  border-radius: 4px;
  font-size: 13px;
}

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

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

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

.fm-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 8px 0;
}

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

.fm-side-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--window-fg-dim);
  padding: 4px 14px 6px;
}

.fm-side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--window-fg);
  border-radius: 0;
}

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

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

.fm-side-item.selected {
  background: var(--sidebar-selected);
  color: var(--sidebar-selected-fg);
}

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

.fm-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.fm-search-bar .sym {
  filter: none;
  opacity: 0.5;
}

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

.fm-content {
  flex: 1;
  overflow: auto;
  padding: 8px;
  min-height: 0;
}

.fm-content.view-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 4px;
  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;
  grid-template-columns: 28px 1fr 80px 100px 110px;
  gap: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--window-fg-dim);
  border-bottom: 1px solid var(--border);
  background: var(--toolbar-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.fm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--window-fg);
  cursor: default;
  background: transparent;
  font-size: 12px;
}

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

.fm-item .fm-item-name {
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

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

.fm-item.selected {
  background: var(--list-selected);
  color: var(--list-selected-fg);
  border-color: transparent;
}

.fm-item .fm-meta {
  display: none;
}

/* List view rows */
.fm-content.view-list .fm-item {
  display: grid;
  grid-template-columns: 28px 1fr 80px 100px 110px;
  gap: 8px;
  align-items: center;
  flex-direction: unset;
  padding: 4px 12px;
  border-radius: 0;
  border: none;
}

.fm-content.view-list .fm-item:nth-child(even) {
  background: var(--list-alt);
}

.fm-content.view-list .fm-item:hover {
  background: var(--list-hover);
}

.fm-content.view-list .fm-item.selected {
  background: var(--list-selected);
  color: var(--list-selected-fg);
}

.fm-content.view-list .fm-item img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.fm-content.view-list .fm-item .fm-item-name {
  text-align: left;
  -webkit-line-clamp: 1;
  min-width: 0;
  justify-self: start;
}

.fm-content.view-list .fm-item .fm-meta {
  display: contents;
}

.fm-content.view-list .fm-item .fm-size,
.fm-content.view-list .fm-item .fm-type,
.fm-content.view-list .fm-item .fm-modified {
  display: block;
  font-size: 12px;
  color: inherit;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-content.view-list .fm-item .fm-size {
  text-align: right;
}

.fm-statusbar {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--window-fg-dim);
  border-top: 1px solid var(--border);
  background: var(--toolbar-bg);
}

/* ---------- Terminal ---------- */

.term-window {
  top: 100px;
  left: 200px;
  width: min(640px, calc(100vw - var(--launcher-width) - 64px));
  height: min(400px, calc(100vh - var(--panel-height) - 64px));
  background: #1e1e1e;
}

.term-window.maximized {
  top: var(--panel-height) !important;
  left: var(--launcher-width) !important;
  width: calc(100% - var(--launcher-width)) !important;
  height: calc(100% - var(--panel-height)) !important;
}

.term-body {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  color: #e0e0e0;
  overflow: auto;
  background: #1e1e1e;
}

.term-prompt {
  color: #8ae234;
  font-weight: 700;
}

.term-path {
  color: #729fcf;
}

.term-cmd {
  color: #eeeeec;
}

.term-out {
  color: #d3d7cf;
}

.term-cursor {
  animation: blink 1s step-end infinite;
  color: #eeeeec;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- Focus / z-order helpers ---------- */

.window.focused {
  z-index: 60;
}

.window.focused .titlebar {
  background: linear-gradient(to bottom, #6a675f 0%, #4a4943 100%);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
