/* ============================================================
   FinixOS 1.0 Pro — Finix Core / x86_64 visual system
   ============================================================ */

:root {
  --panel-height: 32px;

  /* FinixOS Dark (default) — enforced dark surfaces */
  --panel-bg: rgba(30, 30, 30, 0.78);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-text: #ffffff;

  --window-bg: #242424;
  --window-header: #2d2d2d;
  --window-border: rgba(255, 255, 255, 0.1);

  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --surface-3: rgba(255, 255, 255, 0.16);
  --card-bg: #2d2d2d;
  --card-bg-2: #333333;
  --menu-bg: #333333;
  --menu-hover: rgba(255, 255, 255, 0.12);

  --text: #ffffff;
  --muted: #b6b6b8;

  --desktop-fallback: #1e1e1e;

  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 28px 64px rgba(0, 0, 0, 0.55);

  --danger: #ff7b63;
  --success: #8ff0a4;
  --warning: #f9c440;

  /* Accent (overridden by accent-* body classes) */
  --accent: #3584e4;
  --accent-hover: #4a90e8;
  --accent-soft: rgba(53, 132, 228, 0.22);
  --accent-fg: #ffffff;

  --dock-bg: rgba(255, 255, 255, 0.15);
  --radius: 12px;
  --radius-lg: 18px;

  --adwaita-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --adwaita-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --gnome-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- FinixOS Light (applied only when body.theme-light is set) ---------- */
body.theme-light {
  --panel-bg: rgba(246, 246, 246, 0.82);
  --panel-border: rgba(0, 0, 0, 0.09);
  --panel-text: #1d1d20;

  --window-bg: #f6f6f6;
  --window-header: #ececec;
  --window-border: rgba(0, 0, 0, 0.1);

  --surface: rgba(0, 0, 0, 0.05);
  --surface-2: rgba(0, 0, 0, 0.08);
  --surface-3: rgba(0, 0, 0, 0.13);
  --card-bg: #ffffff;
  --card-bg-2: #f1f1f1;
  --menu-bg: #ffffff;
  --menu-hover: rgba(0, 0, 0, 0.07);

  --text: #1d1d20;
  --muted: #5e5e64;
  --desktop-fallback: #f6f6f6;

  --dock-bg: rgba(255, 255, 255, 0.5);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.14);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.2);
  --shadow-3: 0 28px 64px rgba(0, 0, 0, 0.26);
}

/* ---------- Accents ---------- */
body.accent-blue   { --accent: #3584e4; --accent-hover: #4a90e8; --accent-soft: rgba(53,132,228,0.22); }
body.accent-teal   { --accent: #2190a4; --accent-hover: #2ba7be; --accent-soft: rgba(33,144,164,0.22); }
body.accent-green  { --accent: #3a944a; --accent-hover: #47ad59; --accent-soft: rgba(58,148,74,0.22); }
body.accent-orange { --accent: #ed5b00; --accent-hover: #ff6f1a; --accent-soft: rgba(237,91,0,0.22); }
body.accent-purple { --accent: #9141ac; --accent-hover: #a44ec0; --accent-soft: rgba(145,65,172,0.22); }

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Cantarell", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background-color: var(--desktop-fallback, #1e1e1e);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  transition: color 420ms cubic-bezier(0.22, 1, 0.36, 1), background 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
body.theme-animating::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: color-mix(in srgb, var(--window-bg) 35%, transparent);
  animation: theme-wash 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes theme-wash {
  from { opacity: 0.7; }
  to { opacity: 0; }
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
input, textarea { user-select: text; }
.hidden { display: none !important; }

/* ============================================================
   DESKTOP + FINIXOS LOCAL WALLPAPER
   ============================================================ */
.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  /* Solid dark fallback shows while the wallpaper image loads. */
  background-color: var(--desktop-fallback, #1e1e1e);
  background-image: url('FinixOS.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
}

.wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Transparent so the desktop wallpaper image shows through the layer. */
  background-color: transparent;
  filter: var(--brightness-filter, brightness(1));
  transition: filter 620ms var(--gnome-ease);
}

/* Dynamic raster layer: shows the bundled FinixOS.png by default and swaps to
   any uploaded Base64 image. Sits above the solid .wallpaper base. */
.wallpaper-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: var(--brightness-filter, brightness(1));
  transition: opacity 620ms var(--gnome-ease), filter 620ms var(--gnome-ease);
  pointer-events: none;
}

.wallpaper-veil {
  display: none;
}

.background-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: none;
  transition: opacity 500ms var(--gnome-ease);
}

.brightness-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 140ms linear;
}

.screen-scrim {
  position: absolute;
  inset: 0;
  z-index: 840;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(24px) saturate(0.6);
  -webkit-backdrop-filter: blur(24px) saturate(0.6);
  pointer-events: none;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top-panel {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--panel-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 500;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 2px 12px rgba(0, 0, 0, 0.22);
  transition: background 400ms var(--gnome-ease);
  font-size: 13px;
}

.panel-left, .panel-center, .panel-right {
  display: flex;
  align-items: center;
  height: 100%;
}
.panel-left { justify-self: start; padding-left: 8px; gap: 6px; }
.panel-center { justify-self: center; }
.panel-right { justify-self: end; padding-right: 8px; gap: 6px; }

.panel-button {
  color: var(--panel-text);
  border-radius: 999px;
  padding: 3px 10px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 180ms var(--adwaita-ease), transform 180ms var(--adwaita-spring);
}
.panel-button:hover { background: var(--surface-2); }
.panel-button:active { transform: scale(0.95); }

.activities-button { font-weight: 700; letter-spacing: 0.01em; }
body.overview-active .activities-button {
  background: var(--accent);
  color: var(--accent-fg);
}

.active-window-title {
  color: var(--panel-text);
  font-weight: 700;
  font-size: 13px;
  opacity: 0.95;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 4px;
}

.clock-button { font-weight: 700; gap: 8px; }
.clock-date { font-weight: 500; opacity: 0.78; font-size: 12px; }

.icon-button {
  width: 26px; height: 26px;
  padding: 0;
  justify-content: center;
  position: relative;
}
.icon-button svg { width: 15px; height: 15px; fill: currentColor; }

.notification-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--panel-bg);
}

.quick-settings-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  color: var(--panel-text);
  font-size: 12px;
  font-weight: 600;
  transition: background 180ms var(--adwaita-ease), transform 180ms var(--adwaita-spring);
}
.quick-settings-pill:hover { background: var(--surface-2); }
.quick-settings-pill:active { transform: scale(0.97); }
.quick-settings-pill.open { background: var(--surface-3); }

.setting-pill { display: inline-flex; align-items: center; justify-content: center; gap: 3px; transition: opacity 200ms ease, filter 200ms ease; }
.setting-pill svg { width: 13px; height: 13px; fill: currentColor; }
.setting-pill.off { opacity: 0.4; filter: grayscale(1); }
.setting-pill.battery { font-size: 11px; font-weight: 700; }
.setting-pill.battery.low svg { fill: var(--warning); }
.setting-pill.charging svg { fill: var(--success); }

/* ============================================================
   FLOATING PANELS
   ============================================================ */
.floating-panel {
  position: absolute;
  top: calc(var(--panel-height) + 8px);
  z-index: 520;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  color: var(--text);
  overflow: hidden;
  animation: pop-in 260ms var(--gnome-ease);
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.calendar-panel { left: 50%; transform: translateX(-50%); width: min(380px, 88vw); }

.calendar-header {
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, var(--card-bg-2), var(--card-bg));
  border-bottom: 1px solid var(--window-border);
}
.calendar-header-day { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.calendar-header-time { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }

.calendar-body { padding: 14px 16px 10px; }
.calendar-month { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.04em; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  font-size: 12px;
}
.calendar-grid .day-name {
  display: grid; place-items: center;
  min-height: 22px;
  font-weight: 800;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}
.calendar-grid .day-cell {
  display: grid; place-items: center;
  min-height: 30px;
  border-radius: 50%;
  transition: background 160ms var(--adwaita-ease);
}
.calendar-grid .day-cell.other { opacity: 0.3; }
.calendar-grid .day-cell:hover:not(.empty) { background: var(--surface-2); }
.calendar-grid .day-cell.today {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 800;
  box-shadow: 0 4px 12px var(--accent-soft);
}

.calendar-notifications {
  border-top: 1px solid var(--window-border);
  padding: 12px 16px 14px;
  background: var(--card-bg-2);
}
.calendar-notifications-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.calendar-notification-list { display: grid; gap: 6px; max-height: 150px; overflow: auto; }
.calendar-empty { font-size: 12px; color: var(--muted); padding: 6px 0; }
.calendar-note {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--window-border);
}

/* ---------- Quick Settings ---------- */
.quick-settings {
  right: 10px;
  width: min(330px, 90vw);
  padding: 14px;
  display: grid;
  gap: 12px;
  animation: qs-slide 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes qs-slide {
  from { opacity: 0; transform: translateX(28px) translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.qs-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.qs-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  text-align: left;
  transition: background 200ms var(--adwaita-ease), transform 200ms var(--adwaita-spring), border-color 200ms ease;
}
.qs-tile:hover { background: var(--surface-2); }
.qs-tile:active { transform: scale(0.96); }
.qs-tile.active {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-fg);
  box-shadow: 0 6px 18px var(--accent-soft);
}
.qs-tile-icon { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; }
.qs-tile-icon svg { width: 18px; height: 18px; fill: currentColor; }
.qs-tile-text { display: grid; line-height: 1.15; overflow: hidden; }
.qs-tile-text strong { font-size: 12px; font-weight: 700; }
.qs-tile-text small { font-size: 10px; opacity: 0.72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.qs-slider-block {
  background: var(--surface);
  border: 1px solid var(--window-border);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
}
.qs-slider-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.qs-slider-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; }
.qs-slider-label svg { width: 15px; height: 15px; fill: currentColor; }
.qs-slider-value { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

input[type="range"].qs-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
input[type="range"].qs-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}
input[type="range"].qs-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}
input[type="range"].qs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px; height: 17px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 160ms var(--adwaita-spring);
}
input[type="range"].qs-slider::-webkit-slider-thumb:hover { transform: scale(1.18); }
input[type="range"].qs-slider::-moz-range-thumb {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.quick-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 2px;
}

select {
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select:hover { background-color: var(--surface-2); }
select:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

/* Native dropdown list — explicit dark surface with light text so every
   option stays readable before, during and after hover. */
select option {
  background: #333333;
  color: #ffffff;
  padding: 6px 10px;
  font-size: 13px;
}
select option:checked,
select option:hover,
select option:focus {
  background: #3d6fd6;
  color: #ffffff;
}
select optgroup {
  background: #333333;
  color: #cccccc;
}
body.theme-light select option {
  background: #333333;
  color: #ffffff;
}

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.switch .slider {
  position: absolute; inset: 0;
  background: var(--surface-3);
  border-radius: 999px;
  transition: background 220ms var(--adwaita-ease);
  pointer-events: none;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 260ms var(--adwaita-spring);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-soft); }

.qs-footer { display: flex; gap: 8px; }
.power-action {
  flex: 1;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  transition: background 180ms var(--adwaita-ease), transform 180ms var(--adwaita-spring);
}
.power-action svg { width: 17px; height: 17px; fill: currentColor; }
.power-action:hover { background: var(--surface-2); }
.power-action:active { transform: scale(0.94); }
.power-action.danger { color: var(--danger); }
.power-action.danger:hover { background: rgba(255, 123, 99, 0.16); }

/* ============================================================
   DOCK — translucent glass pill with magnification
   ============================================================ */
.dock,
.dock-container {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 24px;
  background: rgba(20, 20, 25, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.42),
    0 2px 0 rgba(255, 255, 255, 0.14) inset,
    0 -1px 0 rgba(0, 0, 0, 0.18) inset;
  z-index: 400;
  transition: transform 380ms var(--gnome-ease), opacity 380ms var(--gnome-ease);
}

body.overview-active .dock { transform: translateX(-50%) translateY(160%); opacity: 0; pointer-events: none; }

.dock-app {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
  transform-origin: bottom center;
  transition: transform 260ms var(--adwaita-spring), filter 260ms var(--adwaita-ease), background 200ms ease;
  will-change: transform;
}
.dock-app:hover {
  transform: translateY(-8px) scale(1.15);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
}
.dock-app:active { transform: scale(1.05) translateY(-3px); }
.dock-app .dock-icon { width: 46px; height: 46px; display: grid; place-items: center; }
.dock-app .dock-icon i { color: #fff; font-size: 22px; line-height: 1; }
.dock-item.app-grid-btn { background: rgba(255, 255, 255, 0.12); color: #fff; }
.dock-item.app-grid-btn .dock-icon i { color: #fff; }
.dock-item.app-grid-btn:hover { background: rgba(255, 255, 255, 0.2); }
.dock-item[data-app="files"] { background: #3584e4; }
.dock-item[data-app="terminal"] { background: #2d2d2d; }
.dock-item[data-app="terminal"] .dock-icon i { color: #4deeea; }
.dock-item[data-app="editor"] { background: #e66100; }
.dock-item[data-app="browser"] { background: linear-gradient(135deg, #ff9400, #ff0039, #9059ff); }
.dock-item[data-app="software"] { background: #1296db; }
.dock-item[data-app="settings"] { background: #5e5c64; }

.dock-app.running::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text);
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
  animation: dot-in 260ms var(--adwaita-spring);
}
@keyframes dot-in { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }

.dock-app.focused {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.dock-separator { width: 1px; height: 28px; align-self: center; flex: 0 0 1px; background: rgba(255, 255, 255, 0.2); margin: 0 4px; }

/* ============================================================
   WINDOWS
   ============================================================ */
.windows-layer { position: absolute; inset: 0; z-index: 100; pointer-events: none; }

.window {
  position: absolute;
  pointer-events: auto;
  border-radius: 14px;
  background: var(--window-bg);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  min-width: 320px;
  min-height: 220px;
  transform-origin: center center;
  animation: window-open 320ms var(--adwaita-ease);
  transition: left 300ms var(--adwaita-ease), top 300ms var(--adwaita-ease),
              width 300ms var(--adwaita-ease), height 300ms var(--adwaita-ease),
              opacity 200ms var(--adwaita-ease), transform 260ms var(--adwaita-ease);
}

@keyframes window-open {
  0%   { opacity: 0; transform: scale(0.86) translateY(18px); }
  60%  { opacity: 1; transform: scale(1.015) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.window.closing { opacity: 0; transform: scale(0.88) translateY(16px); }
.window.minimizing { opacity: 0; transform: scale(0.35) translateY(38vh); }
.window.maximized { border-radius: 12px; }
.window.focused { box-shadow: 0 34px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px var(--accent-soft); }
.window.dragging { transition: none; }

.window-header {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  background: var(--window-header);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  cursor: grab;
  user-select: none;
}
.window-header.dragging { cursor: grabbing; }

.window-controls { display: flex; align-items: center; gap: 7px; padding-left: 2px; }
.window-control {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: background 160ms ease, transform 160ms var(--adwaita-spring);
}
.window-control svg { width: 11px; height: 11px; fill: currentColor; opacity: 0.85; }
.window-control:hover { background: var(--surface-3); transform: scale(1.1); }
.window-control.close:hover { background: var(--danger); color: #fff; }
.window-control.close:hover svg { opacity: 1; }

.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-titlebar-right { width: 74px; display: flex; justify-content: flex-end; }
.window-menu-button {
  width: 26px; height: 24px;
  border-radius: 8px;
  display: grid; place-items: center;
  transition: background 160ms ease;
}
.window-menu-button:hover { background: var(--surface-2); }
.window-menu-button svg { width: 14px; height: 14px; fill: var(--text); }

.window-content { position: relative; height: calc(100% - 44px); background: var(--window-bg); overflow: hidden; }

.window-resize-handle {
  position: absolute;
  right: 0; bottom: 0;
  width: 18px; height: 18px;
  cursor: nwse-resize;
}

#snap-preview {
  position: absolute;
  z-index: 90;
  pointer-events: none;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.12);
  transition: all 140ms var(--gnome-ease);
}

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.context-menu {
  position: absolute;
  min-width: 140px;
  max-width: 180px;
  padding: 5px;
  border-radius: 10px;
  background: var(--menu-bg);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-2);
  z-index: 700;
  animation: pop-in 150ms var(--gnome-ease);
}
.context-menu button {
  display: block;
  width: 100%;
  max-width: 180px;
  text-align: left;
  padding: 6px 10px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 120ms ease, color 120ms ease;
}
.context-menu button:hover { background: var(--menu-hover); }
.context-menu button.danger { color: #ff7b63; }
.context-menu button.danger:hover { background: rgba(255, 123, 99, 0.16); }

/* ============================================================
   NOTIFICATIONS + OSD
   ============================================================ */
.notifications-layer {
  position: absolute;
  top: calc(var(--panel-height) + 10px);
  right: 12px;
  width: 320px;
  z-index: 560;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.notification {
  pointer-events: auto;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  border-radius: var(--radius);
  padding: 11px 13px;
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 13px;
  display: grid;
  gap: 2px;
  animation: note-in 340ms var(--adwaita-ease);
}
.notification strong { font-size: 13px; font-weight: 700; }
.notification span { font-size: 12px; color: var(--muted); }
.notification.leaving { animation: note-out 240ms var(--adwaita-ease) forwards; }

@keyframes note-in {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes note-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(0.96); }
}

.osd {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 640;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  box-shadow: var(--shadow-2);
  animation: pop-in 200ms var(--gnome-ease);
}
.osd-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.osd-icon svg { width: 18px; height: 18px; fill: #fff; }
.osd-track { width: 150px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.24); overflow: hidden; }
.osd-track span { display: block; height: 100%; width: 80%; border-radius: 999px; background: #fff; transition: width 120ms linear; }
.osd-value { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ============================================================
   OVERVIEW (GNOME 46 Activities)
   ============================================================ */
.overview {
  position: absolute;
  inset: 0;
  z-index: 450;
  padding: calc(var(--panel-height) + 18px) 46px 90px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 14px;
  overflow: hidden;
  animation: overview-in 380ms var(--gnome-ease);
}

@keyframes overview-in {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}

.overview-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.overview-search-wrap {
  flex: 0 1 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: box-shadow 200ms ease, background 200ms ease;
}
.overview-search-wrap:focus-within { background: rgba(0, 0, 0, 0.55); box-shadow: 0 0 0 3px var(--accent-soft); }
.overview-search-wrap svg { width: 16px; height: 16px; fill: #fff; opacity: 0.8; flex: 0 0 16px; }
.overview-search-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  color: #fff;
  font-size: 14px;
}
.overview-search-wrap input::placeholder { color: rgba(255, 255, 255, 0.6); }

.overview-clock { color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }

.overview-workspaces { display: flex; justify-content: center; }
.workspace-strip { display: flex; gap: 12px; }
.workspace-thumb {
  width: 150px;
  border-radius: 12px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.34);
  border: 2px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  gap: 5px;
  transition: transform 260ms var(--adwaita-spring), border-color 220ms ease, background 220ms ease;
}
.workspace-thumb:hover { transform: translateY(-3px); }
.workspace-thumb.active { border-color: #fff; background: rgba(255, 255, 255, 0.16); }
.workspace-thumb-inner {
  height: 76px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(53, 132, 228, 0.85), rgba(0, 20, 60, 0.9));
}
.workspace-thumb-label { font-size: 10px; font-weight: 700; color: #fff; text-align: center; opacity: 0.85; }

.window-previews { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: flex-start; min-height: 0; overflow: auto; }
.preview-window {
  width: 210px;
  height: 128px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #fff;
  transition: transform 220ms var(--adwaita-spring), box-shadow 220ms ease, border-color 220ms ease;
}
.preview-window:hover { transform: scale(1.05); border-color: #fff; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5); }
.preview-window-header {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-window-body { flex: 1; display: grid; place-items: center; opacity: 0.6; }
.preview-window-body svg { width: 42px; height: 42px; }
.preview-empty { width: 100%; text-align: center; color: rgba(255, 255, 255, 0.65); font-size: 13px; padding: 22px 0; }

.overview-grid-wrap {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px 16px 18px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overflow: auto;
  min-height: 0;
}
.overview-grid-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.overview-grid-title { color: #fff; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.overview-grid-hint { color: rgba(255, 255, 255, 0.6); font-size: 11px; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  align-content: start;
}
.app-launcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 14px 8px;
  border-radius: 14px;
  color: #fff;
  background: transparent;
  transition: background 180ms var(--adwaita-ease), transform 200ms var(--adwaita-spring);
}
.app-launcher:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-3px); }
.app-launcher:active { transform: scale(0.95); }
.app-launcher-icon { width: 56px; height: 56px; display: grid; place-items: center; }
.app-launcher-icon svg { width: 56px; height: 56px; display: block; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4)); }
.app-launcher-name { font-size: 12px; font-weight: 600; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }

/* ============================================================
   APPS
   ============================================================ */
.app-window { display: flex; flex-direction: column; height: 100%; }

/* ---------- GNOME Terminal ---------- */
.terminal-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #1a1a1a;
  font-family: "Source Code Pro", "Consolas", "SFMono-Regular", monospace;
}
.terminal-tabbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 6px 10px;
  background: #2b2b2b;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}
.terminal-tab {
  font-size: 11px;
  font-weight: 700;
  color: #d8d8d8;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 7px;
}
/* Scroll container: the whole transcript (output lines + live input line)
   lives inside this box so the prompt sits directly below the welcome output
   at the top of the flow, exactly like a real Linux terminal, instead of
   being pinned to the bottom of the window. */
.terminal-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 16px;
  background: #1a1a1a;
  scrollbar-width: thin;
}
.terminal-viewport::-webkit-scrollbar { width: 8px; }
.terminal-viewport::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }

/* Output buffer — flex column that stacks every printed line and the live
   prompt at the top of the box, in normal top-to-bottom flow. */
.terminal-output {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  color: #e6e6e6;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-line {
  width: 100%;
  white-space: pre-wrap;
  text-align: left;
}
.terminal-line.terminal-fastfetch {
  width: auto;
  white-space: pre;
  color: #e6e6e6;
}
.terminal-line .u-prompt { color: #33d17a; font-weight: 700; }
.terminal-line .h-prompt { color: #62a0ea; font-weight: 700; }
.terminal-line .p-prompt { color: #c061cb; font-weight: 700; }
.terminal-line .prompt-echo { opacity: 0.95; }
.terminal-line .cmd-echo { color: #f5f5f5; }

/* Matrix rain — keep the green glyph grid from wrapping mid-frame. */
.terminal-line.terminal-matrix {
  white-space: pre;
  overflow: hidden;
  text-shadow: 0 0 6px rgba(51, 209, 122, 0.35);
  animation: matrix-in 420ms ease-out;
}
@keyframes matrix-in {
  from { opacity: 0; filter: brightness(2); }
  to   { opacity: 1; filter: brightness(1); }
}
.ff-logo { color: #51a2da; font-weight: 700; }
.ff-key { color: #62a0ea; font-weight: 700; }
.ff-title { color: #f6d32d; font-weight: 700; }
.ff-ok { color: #33d17a; font-weight: 700; }
.ff-warn { color: #f6d32d; font-weight: 700; }
.ff-err { color: #ff7b63; font-weight: 700; }
.ff-muted { color: #8a8a8e; }

/* Live prompt line: scrolls with the transcript as the last line of output. */
.terminal-prompt-line {
  display: flex;
  align-items: baseline;
  width: 100%;
  gap: 0;
}
.terminal-prompt-line .prompt-label { font-size: 13px; white-space: pre; }
.terminal-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  padding: 0 0 0 6px;
  color: #e6e6e6;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  caret-color: #33d17a;
}

/* ---------- Nautilus Files ---------- */
.file-manager { height: 100%; display: grid; grid-template-rows: auto 1fr; background: var(--window-bg); }
.file-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.nav-button, .toolbar-button {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 160ms var(--adwaita-ease), transform 160ms var(--adwaita-spring);
}
.nav-button:hover, .toolbar-button:hover { background: var(--surface-2); }
.nav-button:active, .toolbar-button:active { transform: scale(0.94); }
.nav-button svg { width: 15px; height: 15px; fill: currentColor; }
.toolbar-button.accent { background: var(--accent); border-color: transparent; color: var(--accent-fg); }

.breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  border-radius: 9px;
  padding: 0 6px;
  height: 32px;
  overflow: hidden;
}
.crumb {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 140ms ease;
}
.crumb:hover { background: var(--surface-2); }
.crumb-sep { opacity: 0.45; font-size: 11px; }

.file-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 0.62fr); min-height: 0; }
.file-list { padding: 10px; overflow: auto; display: grid; gap: 2px; align-content: start; }
.file-list.grid-view { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 140ms ease;
}
.file-item:hover { background: var(--surface-2); }
.file-item.selected { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.file-item .icon { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 26px; }
.file-item .icon svg { width: 26px; height: 26px; display: block; }
.file-item .name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta { font-size: 11px; color: var(--muted); }

.grid-view .file-item {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 12px 6px;
}
.grid-view .file-item .icon, .grid-view .file-item .icon svg { width: 46px; height: 46px; flex: none; }
.grid-view .file-item .name { font-size: 12px; max-width: 100%; }
.grid-view .file-item .meta { display: none; }

.file-preview {
  border-left: 1px solid var(--window-border);
  background: var(--card-bg-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.file-preview-header {
  padding: 12px 14px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.file-preview-icon { display: grid; place-items: center; padding: 4px 0 10px; }
.file-preview-icon svg { width: 72px; height: 72px; }
.file-preview-body {
  margin: 0;
  padding: 0 14px 14px;
  white-space: pre-wrap;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  font-family: "Source Code Pro", "Consolas", monospace;
  min-height: 0;
}
.file-preview-meta { padding: 0 14px 14px; font-size: 11px; color: var(--muted); display: grid; gap: 3px; }
.file-empty { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; grid-column: 1 / -1; }

/* ---------- Text Editor ---------- */
.editor-shell { height: 100%; display: grid; grid-template-rows: auto 1fr; background: var(--window-bg); }
.editor-tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
  overflow-x: auto;
}
.editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 160ms ease;
}
.editor-tab:hover { background: var(--surface-2); }
.editor-tab.active { background: var(--accent); color: var(--accent-fg); }
.editor-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.55; }
.editor-body { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--window-border);
  background: var(--window-bg);
}
.editor-title { font-size: 12px; color: var(--muted); font-weight: 600; }
.editor-area {
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  outline: none;
  background: var(--window-bg);
  color: var(--text);
  font-family: "Source Code Pro", "Consolas", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  padding: 16px 18px;
}

/* ============================================================
   FINIX CODE — live HTML/CSS/JS editor + preview + console
   ============================================================ */
.code-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #1e1e22;
  color: #e6e6e6;
  font-family: "Cantarell", "Inter", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

/* ---------- toolbar ---------- */
.code-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #26262c;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  flex-wrap: nowrap;
}
.code-brand { display: flex; align-items: center; gap: 8px; margin-right: 4px; flex: 0 0 auto; }
.code-brand-mark {
  font-family: "Source Code Pro", "Consolas", monospace;
  font-weight: 800;
  font-size: 13px;
  color: #4deeea;
  background: rgba(77, 238, 234, 0.12);
  border: 1px solid rgba(77, 238, 234, 0.35);
  border-radius: 7px;
  padding: 3px 7px;
  line-height: 1;
}
.code-brand-name { font-size: 13px; font-weight: 800; letter-spacing: 0.01em; white-space: nowrap; }
.code-spacer { flex: 1 1 auto; }

.code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6e6e6;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms var(--adwaita-spring);
}
.code-btn svg { width: 14px; height: 14px; fill: currentColor; }
.code-btn:hover { background: rgba(255, 255, 255, 0.16); }
.code-btn:active { transform: scale(0.95); }
.code-btn.accent { background: #33d17a; border-color: transparent; color: #08240f; }
.code-btn.accent:hover { background: #47e08c; }

.code-autorun { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; flex: 0 0 auto; }
.code-autorun input { position: absolute; opacity: 0; width: 0; height: 0; }
.code-switch {
  position: relative;
  width: 38px; height: 21px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 200ms ease;
  flex: 0 0 38px;
}
.code-switch::before {
  content: "";
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 220ms var(--adwaita-spring);
}
.code-autorun input:checked + .code-switch { background: #33d17a; }
.code-autorun input:checked + .code-switch::before { transform: translateX(17px); }
.code-autorun input:focus-visible + .code-switch { box-shadow: 0 0 0 3px rgba(51, 209, 122, 0.3); }
.code-autorun-label { font-size: 12px; font-weight: 700; color: #cfcfd4; white-space: nowrap; }

.code-field { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.code-field-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #9a9aa2; }
.code-select {
  height: 30px;
  border-radius: 9px;
  background: #33333a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e6e6e6;
  font-size: 12px;
  font-weight: 600;
  padding: 0 26px 0 10px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #e6e6e6 50%),
                    linear-gradient(135deg, #e6e6e6 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.code-select:hover { background-color: #3d3d46; }
.code-select option { background: #33333a; color: #fff; }

/* ---------- split workspace ---------- */
.code-main {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}
.code-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.code-inputs { flex: 0 0 50%; background: #202027; }
.code-output { flex: 1 1 auto; background: #26262c; }

.code-splitter {
  flex: 0 0 6px;
  cursor: col-resize;
  background: #1a1a1f;
  border-left: 1px solid rgba(0, 0, 0, 0.5);
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  transition: background 160ms ease;
}
.code-splitter:hover, .code-splitter.dragging { background: #33d17a; }

/* ---------- tabs ---------- */
.code-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 6px 6px 0;
  background: #1c1c22;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  overflow-x: auto;
  scrollbar-width: thin;
}
.code-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 9px 9px 0 0;
  background: transparent;
  color: #9a9aa2;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 0;
  transition: background 160ms ease, color 160ms ease;
}
.code-tab svg { width: 13px; height: 13px; fill: currentColor; }
.code-tab:hover { background: rgba(255, 255, 255, 0.05); color: #e6e6e6; }
.code-tab.active {
  background: #202027;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 -2px 0 #33d17a;
}
.output-tabs .code-tab.active { background: #26262c; box-shadow: inset 0 -2px 0 #4deeea; }
.code-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.code-dot.html { background: #e44d26; }
.code-dot.css { background: #3d8bec; }
.code-dot.js { background: #f6d32d; }

.code-badge {
  min-width: 16px; height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 999px;
  background: #f6d32d;
  color: #201d00;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ---------- editors with line numbers ---------- */
.code-editors { position: relative; flex: 1 1 auto; min-height: 0; }
.code-editor-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.code-gutter {
  flex: 0 0 46px;
  padding: 12px 8px 12px 0;
  text-align: right;
  background: #1b1b21;
  border-right: 1px solid rgba(0, 0, 0, 0.45);
  color: #5f5f6a;
  font-family: "Source Code Pro", "Consolas", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.code-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  resize: none;
  outline: none;
  background: #202027;
  color: #e6e6e6;
  font-family: "Source Code Pro", "Consolas", "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.55;
  padding: 12px 14px;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  caret-color: #33d17a;
  scrollbar-width: thin;
}
.code-input::-webkit-scrollbar { width: 10px; height: 10px; }
.code-input::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
.code-input::selection { background: rgba(51, 209, 122, 0.32); }

/* ---------- preview / console stage ---------- */
.code-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.code-preview-wrap, .code-console-wrap { position: absolute; inset: 0; }
.code-preview { width: 100%; height: 100%; border: 0; background: #fff; display: block; }

.code-console-wrap { display: flex; flex-direction: column; background: #14141a; }
.code-console {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px 10px;
  font-family: "Source Code Pro", "Consolas", "SFMono-Regular", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  scrollbar-width: thin;
}
.code-console::-webkit-scrollbar { width: 10px; }
.code-console::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }
.code-log-line {
  display: flex;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: pre-wrap;
  word-break: break-word;
}
.code-log-line .code-log-icon { flex: 0 0 auto; opacity: 0.9; font-weight: 800; }
.code-log-line .code-log-msg { flex: 1 1 auto; }
.code-log-line.log .code-log-msg { color: #d7d7dc; }
.code-log-line.log .code-log-icon { color: #8ab4f8; }
.code-log-line.warn { background: rgba(246, 211, 45, 0.08); }
.code-log-line.warn .code-log-msg, .code-log-line.warn .code-log-icon { color: #f6d32d; }
.code-log-line.error { background: rgba(255, 123, 99, 0.1); }
.code-log-line.error .code-log-msg, .code-log-line.error .code-log-icon { color: #ff7b63; }
.code-log-line.info .code-log-msg, .code-log-line.info .code-log-icon { color: #8a8a96; font-style: italic; }
.code-console-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: #1c1c22;
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  font-size: 11px;
  color: #8a8a96;
}
.code-mini-btn {
  height: 22px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d7d7dc;
  font-size: 11px;
  font-weight: 700;
}
.code-mini-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- status bar ---------- */
.code-statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 12px;
  background: #17171c;
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  font-size: 11px;
  color: #9a9aa2;
  font-variant-numeric: tabular-nums;
}
.code-status-right { margin-left: auto; }
.code-status-item.ok { color: #33d17a; }
.code-status-item.err { color: #ff7b63; }

/* ---------- console input line ---------- */
.code-console-inputline {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.45);
  background: #16161c;
}
.code-console-caret {
  font-family: "Source Code Pro", "Consolas", monospace;
  font-size: 13px;
  font-weight: 800;
  color: #4deeea;
}
.code-console-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #e6e6e6;
  font-family: "Source Code Pro", "Consolas", monospace;
  font-size: 12.5px;
  padding: 4px 0;
}
.code-console-input::placeholder { color: #5f5f6a; }

/* ---------- syntax highlight tokens ---------- */
.hl-keyword { color: #c792ea; }
.hl-string { color: #c3e88d; }
.hl-number { color: #f78c6c; }
.hl-comment { color: #6a737d; font-style: italic; }
.hl-tag { color: #ff7b63; }
.hl-attr { color: #ffcb6b; }

/* ---------- toast notification inside the window ---------- */
.code-toast {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(51, 209, 122, 0.95);
  color: #06240f;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  animation: codeToastIn 220ms var(--adwaita-spring);
}
.code-toast.leaving { animation: codeToastOut 220ms ease forwards; }
@keyframes codeToastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes codeToastOut { to { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- open-file modal ---------- */
.code-file-modal { width: min(460px, 90vw); }
.code-file-list {
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--window-bg, #202027);
}
.code-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6e6e6;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}
.code-file-row:hover { background: rgba(77, 238, 234, 0.16); border-color: rgba(77, 238, 234, 0.4); }
.code-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-file-size { flex: 0 0 auto; font-size: 11px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.code-file-empty { padding: 24px; text-align: center; font-size: 12.5px; opacity: 0.6; }

body.theme-light .code-shell { background: #f2f2f5; }
body.theme-light .code-toolbar { background: #e8e8ee; }
body.theme-light .code-statusbar { background: #e2e2ea; }

/* ---------- Epiphany Browser ---------- */
.browser-shell { height: 100%; display: grid; grid-template-rows: auto 1fr; background: var(--window-bg); }
.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.browser-url {
  flex: 1;
  height: 32px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  padding: 0 14px;
  font-size: 12.5px;
  outline: none;
}
.browser-url:focus { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.browser-body { overflow: auto; padding: 30px; background: var(--window-bg); }
.browser-hero { max-width: 620px; margin: 0 auto; display: grid; gap: 18px; }
.browser-hero-logo { display: grid; place-items: center; }
.browser-hero-logo svg { width: 92px; height: 92px; }
.browser-hero h1 { margin: 0; font-size: 26px; font-weight: 800; text-align: center; }
.browser-hero p { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.browser-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.browser-shortcut {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 14px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: background 160ms ease, transform 180ms var(--adwaita-spring);
}
.browser-shortcut:hover { background: var(--surface-2); transform: translateY(-3px); }
.browser-shortcut .shortcut-glyph { font-size: 22px; }
.browser-page { max-width: 680px; margin: 0 auto; line-height: 1.6; font-size: 13.5px; }
.browser-page h2 { font-size: 20px; margin: 0 0 10px; }
.browser-page code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-family: "Consolas", monospace; font-size: 12px; }

/* ---------- Settings ---------- */
.settings-shell { height: 100%; display: grid; grid-template-columns: 190px 1fr; background: var(--window-bg); }
.settings-sidebar {
  background: var(--card-bg-2);
  border-right: 1px solid var(--window-border);
  padding: 12px 8px;
  overflow: auto;
  display: grid;
  gap: 2px;
  align-content: start;
}
.settings-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background 150ms ease;
}
.settings-nav:hover { background: var(--surface); }
.settings-nav.active { background: var(--accent); color: var(--accent-fg); }
.settings-nav .nav-icon { width: 18px; height: 18px; display: grid; place-items: center; }
.settings-nav svg { width: 16px; height: 16px; fill: currentColor; }

.settings-main { overflow: auto; padding: 20px 22px 28px; }
.settings-page { display: grid; gap: 18px; max-width: 720px; }
.settings-page-title { font-size: 20px; font-weight: 800; margin: 0; }
.settings-card {
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-1);
}
.settings-card h3 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.setting-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--window-border);
}
.setting-field:last-child { border-bottom: 0; }
.setting-field .field-label { display: grid; gap: 2px; }
.setting-field .field-label small { color: var(--muted); font-size: 11px; }

.wallpaper-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.wallpaper-swatch {
  height: 72px;
  border-radius: 10px;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 200ms var(--adwaita-spring), border-color 180ms ease, box-shadow 180ms ease;
}
.wallpaper-swatch:hover { transform: scale(1.05); }
.wallpaper-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wallpaper-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--window-border);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.accent-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  transition: transform 200ms var(--adwaita-spring), box-shadow 180ms ease;
}
.accent-dot:hover { transform: scale(1.14); }
.accent-dot.active { box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 6px currentColor; }

/* ---------- Accent colour presets + custom hex picker ---------- */
.settings-hint {
  margin: -4px 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.accent-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.accent-swatch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--surface);
  border: 1.5px solid var(--window-border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: transform 180ms var(--adwaita-spring), border-color 160ms ease, background 160ms ease;
}
.accent-swatch:hover { transform: translateY(-2px); background: var(--surface-2); }
.accent-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px var(--glow-color);
}
.accent-swatch-dot {
  width: 20px; height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.accent-swatch.active .accent-swatch-dot { box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px currentColor; }
.accent-swatch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.accent-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--window-border);
  font-size: 13px;
}
/* The row is a flex container, so restore the stacked label used in setting-field. */
.accent-custom-row .field-label { display: grid; gap: 2px; }
.accent-custom-row .field-label small { color: var(--muted); font-size: 11px; }
.accent-custom-controls { display: flex; align-items: center; gap: 10px; }
.accent-custom-input {
  width: 46px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--window-border);
  background: transparent;
  cursor: pointer;
}
.accent-custom-input::-webkit-color-swatch-wrapper { padding: 2px; }
.accent-custom-input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.accent-custom-input::-moz-color-swatch { border: 0; border-radius: 6px; }
.accent-custom-hex {
  font-family: "Source Code Pro", "Consolas", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--muted);
}

/* ---------- Animation speed selector ---------- */
.anim-speed-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.anim-speed-btn {
  padding: 12px 10px;
  border-radius: 11px;
  background: var(--surface);
  border: 1.5px solid var(--window-border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  transition: transform 180ms var(--adwaita-spring), border-color 160ms ease, background 160ms ease;
}
.anim-speed-btn:hover { transform: translateY(-2px); background: var(--surface-2); }
.anim-speed-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Extensions manager ---------- */
.extension-list { display: grid; gap: 10px; }
.extension-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--surface);
  border: 1.5px solid var(--window-border);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.extension-card.enabled {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}
.extension-icon {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  overflow: hidden;
}
.extension-icon svg { width: 26px; height: 26px; }
.extension-body { flex: 1 1 auto; min-width: 0; }
.extension-name { font-size: 13.5px; font-weight: 700; }
.extension-author { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }
.extension-blurb { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.extension-switch { flex: 0 0 auto; }

/* ---------- Matrix rain extension canvas ---------- */
.matrix-rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}
.matrix-rain-canvas.hidden { display: none; }

/* Desktop icons / widgets layer above the matrix rain canvas (z-index 1). */
.desktop-icons, .desktop-widgets { z-index: 2; }

/* ---------- Extension toggles: hide top-bar widgets ---------- */
#top-panel.no-widgets .panel-center { display: none; }

/* ---------- Global animation speed ---------- */
:root { --anim-time: 1; }

body.anim-instant *,
body.anim-instant *::before,
body.anim-instant *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0ms !important;
}

body.anim-fast .window { animation-duration: calc(240ms * var(--anim-time)); }
body.anim-fast .notification { animation-duration: calc(260ms * var(--anim-time)); }

/* ---------- Blur / glassmorphism off (performance mode) ---------- */
body.no-blur *,
body.no-blur *::before,
body.no-blur *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.no-blur .top-panel,
body.no-blur .dock-container,
body.no-blur .floating-panel,
body.no-blur .calendar-panel,
body.no-blur .quick-settings {
  background: var(--card-bg) !important;
}

/* ---------- High contrast ---------- */
body.high-contrast {
  --window-border: rgba(255, 255, 255, 0.42);
  --surface: rgba(255, 255, 255, 0.14);
  --surface-2: rgba(255, 255, 255, 0.2);
  --muted: #e2e2e6;
}
body.high-contrast.theme-light {
  --window-border: rgba(0, 0, 0, 0.5);
  --surface: rgba(0, 0, 0, 0.1);
  --surface-2: rgba(0, 0, 0, 0.16);
  --muted: #2a2a30;
}
body.high-contrast .settings-card,
body.high-contrast .setting-field { border-width: 2px; }
body.high-contrast .settings-page-title,
body.high-contrast .setting-field .field-label > span { font-weight: 800; }

/* ---------- Glow accent usage across the OS ---------- */
.window.focused {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent-soft), 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 34px var(--glow-color) !important;
}
.dock-app.focused .dock-icon {
  box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--glow-color);
  border-radius: 13px;
}
.dock-app::after { background: var(--accent); }
.prompt-label .u-prompt, .prompt-label .p-prompt { color: var(--accent); }

.about-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.spec-item { background: var(--surface); border: 1px solid var(--window-border); border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.spec-item strong { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 3px; }

.about-hero { display: grid; place-items: center; gap: 6px; padding: 10px 0 16px; }
.about-hero-logo {
  width: 78px; height: 78px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1c71d8, #0a3d8f);
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  box-shadow: var(--shadow-2);
}
.about-hero-name { font-size: 18px; font-weight: 800; }
.about-hero-sub { font-size: 12px; color: var(--muted); }

/* ---------- Calculator ---------- */
.calculator-shell { height: 100%; display: grid; grid-template-rows: auto 1fr; background: var(--window-bg); }
.calc-display {
  padding: 22px 18px 14px;
  text-align: right;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  border-bottom: 1px solid var(--window-border);
  min-height: 96px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.calc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.calc-btn {
  height: 54px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  transition: background 150ms ease, transform 150ms var(--adwaita-spring);
}
.calc-btn:hover { background: var(--surface-2); }
.calc-btn:active { transform: scale(0.94); }
.calc-btn.operator { background: var(--surface-2); }
.calc-btn.equal { background: var(--accent); border-color: transparent; color: var(--accent-fg); }

/* ---------- Image Viewer ---------- */
.image-shell { height: 100%; display: grid; grid-template-rows: auto 1fr; background: #1a1a1a; }
.image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.image-canvas { display: grid; place-items: center; padding: 18px; overflow: auto; }
.image-canvas img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow-2); }

/* ============================================================
   LOCK SCREEN
   ============================================================ */
.lock-screen {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  animation: fade-in 420ms var(--gnome-ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.lock-wallpaper-blur {
  position: absolute;
  inset: 0;
  background-color: var(--desktop-fallback, #1e1e1e);
  background-image: none;
  filter: blur(0px);
  transform: scale(1.06);
}
.lock-wallpaper-blur::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px) brightness(0.7);
  -webkit-backdrop-filter: blur(6px) brightness(0.7);
}

.lock-content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 22px;
  animation: lock-rise 520ms var(--adwaita-ease);
}
@keyframes lock-rise {
  from { opacity: 0; transform: translateY(26px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lock-clock {
  font-size: 68px;
  font-weight: 300;
  color: #fff;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  line-height: 1;
}
.lock-date { font-size: 15px; color: rgba(255, 255, 255, 0.85); margin-top: -14px; }

.lock-card {
  width: min(340px, 84vw);
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 22px 22px 20px;
  border-radius: 22px;
  background: rgba(20, 22, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
  color: #fff;
}
.lock-avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3584e4, #1a5fb4);
  font-weight: 800;
  font-size: 26px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
.lock-user { font-size: 15px; font-weight: 700; }
#lock-password {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  text-align: center;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
#lock-password:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#unlock-button {
  width: 100%;
  border-radius: 11px;
  padding: 11px 18px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 14px;
  transition: background 180ms ease, transform 160ms var(--adwaita-spring);
}
#unlock-button:hover { background: var(--accent-hover); }
#unlock-button:active { transform: scale(0.97); }
.lock-hint { font-size: 11px; color: rgba(255, 255, 255, 0.6); }

.lock-screen.shake .lock-card { animation: shake 380ms ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ============================================================
   SYSTEM OVERLAYS (suspend / shutdown)
   ============================================================ */
.system-overlay {
  position: absolute;
  inset: 0;
  z-index: 910;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(30px) saturate(0.5);
  -webkit-backdrop-filter: blur(30px) saturate(0.5);
  animation: fade-in 300ms var(--gnome-ease);
}

.system-overlay-card {
  width: min(400px, 86vw);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 26px 24px;
  border-radius: 20px;
  background: rgba(30, 30, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-3);
  color: #fff;
  animation: lock-rise 420ms var(--adwaita-ease);
}
.system-overlay-title { font-size: 20px; font-weight: 700; }
.system-overlay-sub { font-size: 13px; color: rgba(255, 255, 255, 0.7); }

.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.system-button {
  min-width: 130px;
  border-radius: 11px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 13px;
  transition: background 180ms ease, transform 160ms var(--adwaita-spring);
}
.system-button:hover { background: var(--accent-hover); }
.system-button:active { transform: scale(0.96); }
.system-button.ghost { background: rgba(255, 255, 255, 0.12); color: #fff; }
.system-button.ghost:hover { background: rgba(255, 255, 255, 0.2); }
.system-button.danger { background: #c01c28; }
.system-button.danger:hover { background: #e01b24; }

.shutdown-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   POWER OFF PROGRESS SCREEN
   ============================================================ */
.poweroff-screen {
  position: absolute;
  inset: 0;
  z-index: 950;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: #0a0a0c;
  color: #fff;
  animation: fade-in 500ms ease;
}
.poweroff-brand { display: grid; justify-items: center; gap: 8px; animation: lock-rise 700ms var(--adwaita-ease); }
.poweroff-logo {
  width: 92px; height: 92px;
  border-radius: 26px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1c71d8, #0a3d8f);
  font-size: 46px;
  font-weight: 800;
  box-shadow: 0 20px 50px rgba(28, 113, 216, 0.4);
}
.poweroff-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.poweroff-sub { font-size: 12px; color: rgba(255, 255, 255, 0.6); letter-spacing: 0.08em; text-transform: uppercase; }

.poweroff-bar { width: 240px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.poweroff-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3584e4, #62a0ea);
  animation: poweroff-fill 3200ms var(--gnome-ease) forwards;
}
@keyframes poweroff-fill { from { width: 0%; } to { width: 100%; } }
.poweroff-status { font-size: 12px; color: rgba(255, 255, 255, 0.65); }

/* ============================================================
   SCROLLBARS (Adwaita style)
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); background-clip: content-box; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 1600px) {
  .dock { padding: 10px 16px; gap: 10px; bottom: 16px; }
  .dock-app { width: 46px; height: 46px; }
  .dock-app .dock-icon { width: 46px; height: 46px; }
  .top-panel { font-size: 13.5px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .app-launcher-icon,
  .app-launcher-icon svg { width: 62px; height: 62px; }
  .workspace-thumb { width: 176px; }
  .workspace-thumb-inner { height: 92px; }
}

@media (max-width: 860px) {
  .settings-shell { grid-template-columns: 1fr; }
  .settings-sidebar { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--window-border); }
  .settings-nav span:last-child { display: none; }
  .file-content { grid-template-columns: 1fr; }
  .file-preview { display: none; }
}

@media (max-width: 720px) {
  .dock { transform: translateX(-50%) scale(0.82); bottom: 8px; }
  .overview { padding: calc(var(--panel-height) + 14px) 16px 80px; }
  .clock-date { display: none; }
  .workspace-thumb { width: 104px; }
  .workspace-thumb-inner { height: 56px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 60ms !important; animation-duration: 60ms !important; }
}/* ============================================================
   FIREFOX BROWSER
   ============================================================ */
.browser-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--window-bg);
  position: relative;
}

.fx-tabbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 0;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.fx-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.fx-tabs::-webkit-scrollbar { height: 0; }

.fx-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 120px;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms var(--adwaita-ease), color 160ms ease;
}
.fx-tab:hover { background: var(--surface); }
.fx-tab.active {
  background: var(--window-bg);
  color: var(--text);
  box-shadow: 0 -1px 0 var(--window-border) inset, 1px 0 0 var(--window-border) inset, -1px 0 0 var(--window-border) inset;
}
.fx-tab-favicon { width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; }
.fx-tab-favicon svg { width: 16px; height: 16px; }
.fx-tab-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-tab-close {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  color: var(--muted);
  flex: 0 0 18px;
}
.fx-tab-close:hover { background: var(--surface-3); color: var(--text); }

.fx-newtab {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  margin-bottom: 4px;
  transition: background 160ms ease;
}
.fx-newtab:hover { background: var(--surface-2); }
.fx-newtab svg { width: 15px; height: 15px; fill: var(--text); }

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}

.fx-url-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.fx-url-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--window-bg);
}
.fx-url-shield svg { width: 14px; height: 14px; fill: var(--success); display: block; }
.fx-url-zoom { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.browser-url {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--text);
  font-size: 12.5px;
}
.browser-url::placeholder { color: var(--muted); }

.fx-suggestions {
  position: absolute;
  top: 88px;
  left: 10px;
  right: 10px;
  z-index: 40;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 6px;
  max-height: 260px;
  overflow: auto;
}
.fx-suggest-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 10px 4px;
}
.fx-suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 12.5px;
  color: var(--text);
  transition: background 140ms ease;
}
.fx-suggest:hover { background: var(--surface-2); }
.fx-suggest-icon { width: 14px; height: 14px; display: grid; place-items: center; flex: 0 0 14px; }
.fx-suggest-icon svg { width: 13px; height: 13px; fill: var(--muted); }

.browser-body { overflow: auto; background: var(--window-bg); }
.fx-statusbar {
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--window-border);
  background: var(--window-header);
}

/* ---------- Firefox home / start page ---------- */
.fx-home {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 34px 24px 44px;
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(255, 95, 31, 0.14) 0%, rgba(255, 95, 31, 0) 60%),
    radial-gradient(70% 60% at 85% 100%, rgba(138, 43, 226, 0.12) 0%, rgba(138, 43, 226, 0) 60%),
    var(--window-bg);
}
.fx-home-logo { width: 84px; height: 84px; display: grid; place-items: center; animation: lock-rise 520ms var(--adwaita-ease); }
.fx-home-logo svg { width: 84px; height: 84px; filter: drop-shadow(0 12px 26px rgba(255, 95, 31, 0.35)); }
.fx-home-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.fx-home-sub { margin: -6px 0 6px; font-size: 13px; color: var(--muted); }

.fx-searchbar {
  width: min(560px, 92%);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 6px 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-1);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.fx-searchbar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-2);
}
.fx-searchbar-icon svg { width: 17px; height: 17px; fill: var(--muted); display: block; }
.fx-searchbar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text);
}
.fx-searchbar-go {
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms var(--adwaita-spring);
}
.fx-searchbar-go:hover { background: var(--accent-hover); }
.fx-searchbar-go:active { transform: scale(0.95); }

.fx-engines { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.fx-engine {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms var(--adwaita-spring);
}
.fx-engine:hover { background: var(--surface-2); color: var(--text); }
.fx-engine.active { background: var(--accent); border-color: transparent; color: var(--accent-fg); }

.fx-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  width: min(560px, 92%);
  margin-top: 10px;
}
.fx-shortcut {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 160ms ease, transform 200ms var(--adwaita-spring), box-shadow 200ms ease;
}
.fx-shortcut:hover {
  background: var(--surface-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow-1);
}
.fx-shortcut-glyph {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

/* ---------- Search results ---------- */
.fx-results { padding: 18px 24px 40px; max-width: 720px; }
.fx-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--window-border);
}
.fx-results-count { font-size: 11.5px; color: var(--muted); }
.fx-results-engine { font-size: 11.5px; font-weight: 700; color: var(--accent); }

.fx-result { padding: 12px 0; }
.fx-result-url { display: block; font-size: 11.5px; color: var(--muted); text-decoration: none; }
.fx-result-title {
  display: block;
  margin: 3px 0 5px;
  font-size: 16px;
  font-weight: 600;
  color: #8ab4f8;
  text-decoration: none;
}
body.theme-light .fx-result-title { color: #1a0dab; }
.fx-result-title:hover { text-decoration: underline; }
.fx-result-snippet { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* ============================================================
   SETTINGS — extra field styles
   ============================================================ */
.slider-field { padding-bottom: 2px; }
.field-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
input[type="range"].settings-slider { width: 100%; margin-bottom: 6px; }

.settings-nav { min-height: 38px; }
.settings-nav .nav-icon svg { stroke: none; }
/* ============================================================
   FIREFOX — live web engine (real search results)
   ============================================================ */
.fx-live {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 0;
  background: var(--window-bg);
}
.fx-live-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card-bg-2);
  border-bottom: 1px solid var(--window-border);
}
.fx-live-notice svg { width: 13px; height: 13px; fill: var(--warning); flex: 0 0 13px; }
.fx-live-notice strong { color: var(--text); font-weight: 700; }
.fx-live-frame { position: relative; min-height: 0; background: #fff; }
.fx-live-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.fx-live-open {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 700;
  transition: background 150ms ease;
}
.fx-live-open:hover { background: var(--accent-hover); }
/* ============================================================
   HD ICON IMAGE SUPPORT (dock, app grid, previews)
   Remote bitmaps/vectors and the inline-SVG fallback share the
   same box so swapping between them never shifts layout.
   ============================================================ */
.dock-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 22%;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.dock-icon .dock-img,
.dock-icon-inline svg { width: 100%; height: 100%; display: block; }

.dock-icon-inline {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.app-launcher-icon .dock-img { width: 100%; height: 100%; }
.preview-window-body .dock-img { width: 42px; height: 42px; }

/* App artwork is decorative — never let it swallow clicks. */
.dock-app .dock-icon,
.app-launcher .app-launcher-icon { pointer-events: none; }

/* ============================================================
   DESKTOP BACKGROUND
   The wallpaper layer is transparent so the FinixOS.png image on
   the .desktop container remains visible; the JS brightness
   control is applied via the wrapper's filter.
   ============================================================ */
.wallpaper {
  background-color: transparent;
  background-image: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* The raster layer stays visible so presets and custom uploads can show. */
.wallpaper-photo {
  display: block;
}

.wallpaper-swatch {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* ============================================================
   macOS-STYLE DOCK MAGNIFICATION
   The JS sets transform on each tile; these make the motion
   fluid and keep the hovered icon above its neighbours.
   ============================================================ */
.dock {
  align-items: flex-end;
  overflow: visible;
}
.dock-app {
  transform-origin: bottom center;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 200ms ease;
}
.dock-app .dock-icon { transition: filter 200ms ease; }
.dock-app:hover .dock-icon { filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.5)); }

body.overview-active .dock-app { transform: none !important; }

/* ============================================================
   WINDOW MINIMISE / RESTORE
   ============================================================ */
.window {
  transition: left 300ms var(--adwaita-ease), top 300ms var(--adwaita-ease),
              width 300ms var(--adwaita-ease), height 300ms var(--adwaita-ease),
              opacity 260ms var(--adwaita-ease), transform 300ms var(--adwaita-ease);
}
.window.minimizing {
  opacity: 0;
  transform: scale(0.22) translateY(42vh);
  filter: blur(2px);
}
.window.closing {
  opacity: 0;
  transform: scale(0.9) translateY(14px);
}

/* ============================================================
   SNAP ASSIST PREVIEW
   ============================================================ */
#snap-preview,
.snap-zone {
  position: absolute;
  z-index: 90;
  pointer-events: none;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border: 2px solid color-mix(in srgb, var(--accent) 80%, white);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 18px 46px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: left 160ms var(--gnome-ease), top 160ms var(--gnome-ease),
              width 160ms var(--gnome-ease), height 160ms var(--gnome-ease), opacity 160ms ease;
  animation: snap-in 160ms var(--gnome-ease);
}
@keyframes snap-in { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   SYSTEM MONITOR
   ============================================================ */
.monitor-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--window-bg);
}

.monitor-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.monitor-tab {
  padding: 6px 14px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: background 160ms ease;
}
.monitor-tab:hover { background: var(--surface-2); }
.monitor-tab.active { background: var(--accent); color: var(--accent-fg); }

.monitor-pane { overflow: auto; min-height: 0; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  border-radius: 12px;
  padding: 12px 14px 10px;
}
.stat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.stat-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-track {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 8px;
}
.stat-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 400ms var(--adwaita-ease), background 300ms ease;
}
.stat-chart { width: 100%; height: 72px; display: block; }
.stat-foot { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ---------- process manager ---------- */
.proc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--window-border);
}
.proc-search {
  flex: 1;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--window-border);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-size: 12.5px;
}
.proc-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.proc-count { font-size: 11.5px; color: var(--muted); }

.proc-table { padding: 8px 10px 16px; }
.proc-head, .proc-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 64px 72px 92px 78px;
  gap: 8px;
  align-items: center;
}
.proc-head {
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.proc-row {
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12px;
  transition: background 140ms ease;
}
.proc-row:hover { background: var(--surface-2); }
.proc-row.idle { opacity: 0.55; }
.proc-name { display: grid; gap: 1px; overflow: hidden; }
.proc-name strong { font-size: 12.5px; font-weight: 600; }
.proc-name small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-pid, .proc-cpu, .proc-mem { font-variant-numeric: tabular-nums; color: var(--muted); }
.proc-actions { display: flex; justify-content: flex-end; }
.proc-kill {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface-2);
  color: #ff7b63;
  font-size: 11px;
  font-weight: 700;
  transition: background 150ms ease, transform 150ms var(--adwaita-spring);
}
.proc-kill:hover { background: rgba(255, 123, 99, 0.2); }
.proc-kill:active { transform: scale(0.94); }
.proc-lock { font-size: 10px; color: var(--muted); opacity: 0.7; }

/* ============================================================
   STICKY NOTES
   ============================================================ */
.notes-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  background: var(--card-bg-2);
}
.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.notes-title { font-size: 12px; font-weight: 700; }
.notes-canvas {
  position: relative;
  overflow: auto;
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  grid-auto-rows: min-content;
  gap: 12px;
  align-content: start;
}

.notes-empty {
  position: absolute;
  inset: 52px 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  pointer-events: none;
}
.notes-empty.hidden { display: none; }
.notes-empty-icon svg { width: 42px; height: 42px; fill: var(--muted); opacity: 0.6; }
.notes-empty-text { font-size: 12.5px; }

.sticky {
  position: relative;
  width: auto;
  min-width: 0;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.sticky.dragging { z-index: 5; }
.sticky-yellow { background: #ffe45c; }
.sticky-green  { background: #b6f0a8; }
.sticky-blue   { background: #a8d8f0; }
.sticky-pink   { background: #f5b0cc; }
.sticky-purple { background: #d4b6f0; }

.sticky-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  background: rgba(0, 0, 0, 0.09);
}
.sticky-grip {
  width: 14px; height: 8px;
  background-image: radial-gradient(circle, rgba(0,0,0,0.35) 1px, transparent 1px);
  background-size: 4px 4px;
  flex: 0 0 14px;
}
.sticky-colors { display: flex; gap: 4px; flex: 1; }
.sticky-color {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  transition: transform 140ms var(--adwaita-spring);
}
.sticky-color:hover { transform: scale(1.25); }
.color-yellow { background: #ffe45c; }
.color-green  { background: #b6f0a8; }
.color-blue   { background: #a8d8f0; }
.color-pink   { background: #f5b0cc; }
.color-purple { background: #d4b6f0; }
.sticky-del {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  color: rgba(0, 0, 0, 0.55);
}
.sticky-del:hover { background: rgba(0, 0, 0, 0.15); }
.sticky-text {
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
  color: #2b2400;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 9px 10px 12px;
  min-height: 128px;
  width: 100%;
  display: block;
}
.sticky-text::placeholder { color: rgba(0, 0, 0, 0.35); }

/* ============================================================
   NOTIFICATION / CONTROL CENTER (top-bar right click)
   ============================================================ */
.calendar-event-list { display: grid; gap: 6px; }
.event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  font-size: 12px;
}
.event-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 7px;
}
.event-time-label { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.event-title-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-del {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; line-height: 1;
  color: var(--muted);
  flex: 0 0 18px;
}
.event-del:hover { background: var(--surface-3); color: var(--text); }

.event-form { display: flex; gap: 6px; margin-top: 8px; }
.event-input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--window-border);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  outline: none;
}
.event-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.event-time { flex: 0 0 92px; }
.event-add {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease;
}
.event-add:hover { background: var(--accent-hover); }

.calendar-quick {
  display: flex;
  gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--window-border);
  background: var(--card-bg-2);
}
.calendar-quick-btn {
  flex: 1;
  padding: 7px 8px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  transition: background 160ms ease, transform 160ms var(--adwaita-spring);
}
.calendar-quick-btn:hover { background: var(--surface-2); }
.calendar-quick-btn:active { transform: scale(0.95); }

.calendar-panel { max-height: calc(100vh - 60px); display: flex; flex-direction: column; }
.calendar-body, .calendar-notifications { flex: 0 0 auto; }
.calendar-notification-list { max-height: 120px; overflow: auto; }
/* ============================================================
   DESKTOP ICON SHORTCUTS
   ============================================================ */
.desktop-icons {
  position: absolute;
  top: var(--panel-height);
  left: 0;
  right: 0;
  bottom: 90px;
  z-index: 20;
  overflow: hidden;
  padding: 0;
  pointer-events: none;
}
.desktop-icon {
  position: absolute;
  width: 92px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  padding: 8px 4px 6px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  pointer-events: auto;
  cursor: grab;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}
.desktop-icon:active { cursor: grabbing; }
.desktop-icon.dragging { z-index: 40; opacity: 0.92; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45)); }
.desktop-icon.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.desktop-icon-art { width: 46px; height: 46px; display: grid; place-items: center; pointer-events: none; }
.desktop-icon-art svg, .desktop-icon-art .dock-img { width: 46px; height: 46px; }
.desktop-icon-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* ============================================================
   1. SOFTWARE CENTER
   ============================================================ */
.software-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: var(--window-bg);
  min-height: 0;
}
.software-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background:
    radial-gradient(120% 160% at 8% 0%, rgba(53, 132, 228, 0.35) 0%, rgba(53, 132, 228, 0) 60%),
    var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.software-hero-icon { width: 52px; height: 52px; flex: 0 0 52px; }
.software-hero-icon svg { width: 52px; height: 52px; }
.software-hero-text h2 { margin: 0 0 2px; font-size: 19px; font-weight: 800; }
.software-hero-text p { margin: 0; font-size: 12.5px; color: var(--muted); }
.software-hero-stat {
  margin-left: auto;
  display: grid;
  justify-items: center;
  padding: 6px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--window-border);
}
.software-hero-stat strong { font-size: 20px; font-weight: 800; }
.software-hero-stat small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.software-cats {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--window-border);
}
.software-cat {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 160ms ease, transform 160ms var(--adwaita-spring);
}
.software-cat:hover { background: var(--surface-2); }
.software-cat.active { background: var(--accent); border-color: transparent; color: var(--accent-fg); }

.software-grid {
  overflow: auto;
  padding: 18px 22px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-content: start;
}
.software-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-1);
  transition: transform 200ms var(--adwaita-spring), border-color 180ms ease, box-shadow 200ms ease;
}
.software-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-2);
}
.software-card-art { width: 56px; height: 56px; display: grid; place-items: center; }
.software-card-art svg, .software-card-art .dock-img { width: 52px; height: 52px; }
.software-card-body { display: grid; gap: 6px; min-width: 0; }
.software-card-head { display: flex; align-items: baseline; gap: 8px; }
.software-card-head strong { font-size: 14px; font-weight: 700; }
.software-card-cat {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.software-card-blurb { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.software-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.software-card-size { font-size: 11px; color: var(--muted); }
.software-card-action { display: flex; align-items: center; gap: 8px; }

.software-btn {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--window-border);
  transition: background 160ms ease, transform 160ms var(--adwaita-spring);
}
.software-btn:hover { background: var(--surface-3); }
.software-btn:active { transform: scale(0.95); }
.software-btn.accent { background: var(--accent); border-color: transparent; color: var(--accent-fg); }
.software-btn.accent:hover { background: var(--accent-hover); }
.software-btn.danger { color: #ff7b63; }
.software-btn.danger:hover { background: rgba(255, 123, 99, 0.18); }

.software-installed-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.software-installed-tag::before { content: "✓"; font-size: 12px; }

.software-progress {
  width: 120px;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.software-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #62d0ff);
  transition: width 160ms linear;
}
.software-progress-label { font-size: 10.5px; color: var(--accent); font-weight: 600; }

/* ============================================================
   2. FOCUS SOUNDSCAPES
   ============================================================ */
.sc-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--window-bg);
  min-height: 0;
}
.sc-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background:
    radial-gradient(120% 160% at 10% 0%, rgba(111, 91, 214, 0.4) 0%, rgba(111, 91, 214, 0) 62%),
    radial-gradient(100% 140% at 90% 100%, rgba(0, 209, 255, 0.18) 0%, rgba(0, 209, 255, 0) 60%),
    var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.sc-hero-art {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 46px;
  padding: 0 4px;
  flex: 0 0 auto;
}
.sc-bar {
  width: 6px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, #8affc1, #66e0ff 55%, #c9a6ff);
  transition: height 220ms var(--adwaita-ease);
}
.sc-hero-art.playing .sc-bar { animation: sc-eq 1100ms ease-in-out infinite alternate; }
.sc-hero-art.playing .sc-bar:nth-child(1) { animation-delay: 0ms; }
.sc-hero-art.playing .sc-bar:nth-child(2) { animation-delay: 120ms; }
.sc-hero-art.playing .sc-bar:nth-child(3) { animation-delay: 240ms; }
.sc-hero-art.playing .sc-bar:nth-child(4) { animation-delay: 60ms; }
.sc-hero-art.playing .sc-bar:nth-child(5) { animation-delay: 300ms; }
.sc-hero-art.playing .sc-bar:nth-child(6) { animation-delay: 180ms; }
.sc-hero-art.playing .sc-bar:nth-child(7) { animation-delay: 360ms; }
.sc-hero-art.playing .sc-bar:nth-child(8) { animation-delay: 90ms; }
.sc-hero-art.playing .sc-bar:nth-child(9) { animation-delay: 270ms; }
@keyframes sc-eq {
  0%   { height: 10px; }
  100% { height: 42px; }
}

.sc-hero-text h2 { margin: 0 0 2px; font-size: 19px; font-weight: 800; }
.sc-hero-text p { margin: 0; font-size: 12.5px; color: var(--muted); }
.sc-master {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px var(--accent-soft);
  transition: background 180ms ease, transform 180ms var(--adwaita-spring);
}
.sc-master:hover { background: var(--accent-hover); }
.sc-master:active { transform: scale(0.96); }
.sc-master.on { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: none; }
.sc-master svg { width: 15px; height: 15px; fill: currentColor; }

.sc-list { overflow: auto; padding: 16px 22px 24px; display: grid; gap: 10px; align-content: start; min-height: 0; }
.sc-track {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
}
.sc-track-art {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
}
.sc-track-art svg { width: 20px; height: 20px; fill: #fff; }
.sc-rain   { background: linear-gradient(140deg, #4a6fa5, #1f3355); }
.sc-ocean  { background: linear-gradient(140deg, #2f8fa8, #12414f); }
.sc-lofi   { background: linear-gradient(140deg, #8a5bd6, #3a1f6b); }
.sc-track-text { display: grid; gap: 2px; min-width: 0; }
.sc-track-text strong { font-size: 13.5px; font-weight: 700; }
.sc-track-text small { font-size: 11.5px; color: var(--muted); }
.sc-track-ctl { display: flex; align-items: center; gap: 10px; }
.sc-vol { width: 130px; }
.sc-vol-val { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.sc-mute {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--window-border);
  transition: background 150ms ease, color 150ms ease;
}
.sc-mute svg { width: 15px; height: 15px; fill: var(--text); }
.sc-mute:hover { background: var(--surface-2); }
.sc-mute.on { background: rgba(255, 123, 99, 0.2); }
.sc-mute.on svg { fill: #ff7b63; }

/* ============================================================
   3. FINIX ARCADE
   ============================================================ */
.arcade-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--window-bg);
  min-height: 0;
}
.arcade-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.arcade-tab {
  padding: 6px 18px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 160ms ease;
}
.arcade-tab:hover { background: var(--surface-2); }
.arcade-tab.active { background: var(--accent); color: var(--accent-fg); }

.arcade-pane {
  overflow: auto;
  padding: 16px 18px 22px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
}
.arcade-hud { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arcade-score {
  display: grid;
  justify-items: center;
  padding: 6px 18px;
  border-radius: 11px;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  min-width: 84px;
}
.arcade-score small { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.arcade-score strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.arcade-hud-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ms-level {
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--window-border);
  background: var(--card-bg);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}
.arcade-hint { font-size: 11.5px; color: var(--muted); }

/* ---------- 2048 ---------- */
.g2048-wrap { position: relative; display: grid; place-items: center; }
.g2048-board {
  display: grid;
  grid-template-columns: repeat(4, 78px);
  grid-template-rows: repeat(4, 78px);
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card-bg-2);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-1);
}
.g-tile {
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 25px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  color: #fff;
  transition: transform 120ms var(--adwaita-spring), background 180ms ease;
  animation: tile-in 150ms var(--adwaita-ease);
}
@keyframes tile-in { from { transform: scale(0.7); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.g-tile.empty { background: rgba(255, 255, 255, 0.045); }
.g-tile.v2    { background: #6b7280; color: #f8fafc; }
.g-tile.v4    { background: #7c8494; color: #f8fafc; }
.g-tile.v8    { background: #ed8a3d; color: #fff; }
.g-tile.v16   { background: #e8703a; color: #fff; }
.g-tile.v32   { background: #e35b48; color: #fff; }
.g-tile.v64   { background: #d63b52; color: #fff; }
.g-tile.v128  { background: #c22f7a; font-size: 22px; }
.g-tile.v256  { background: #a733a0; font-size: 22px; }
.g-tile.v512  { background: #8338c9; font-size: 22px; }
.g-tile.v1024 { background: #5b3ce0; font-size: 19px; }
.g-tile.v2048 { background: linear-gradient(135deg, #ffd24d, #ff9f1c); color: #3b2a00; font-size: 19px; }
.g-tile.vsuper { background: linear-gradient(135deg, #00e0ff, #35e07a); color: #04231a; font-size: 17px; }

.g2048-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  border-radius: 14px;
  background: rgba(12, 14, 20, 0.78);
  backdrop-filter: blur(6px);
  animation: pop-in 200ms var(--gnome-ease);
}
.g2048-overlay-title { font-size: 22px; font-weight: 800; color: #fff; }

/* ---------- Minesweeper ---------- */
.ms-wrap { display: grid; place-items: center; overflow: auto; }
.ms-board {
  --ms-cell: 30px;
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  background: var(--card-bg-2);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-1);
}
.ms-cell {
  width: var(--ms-cell);
  height: var(--ms-cell);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(160deg, #59627a, #3b4256);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: background 130ms ease, transform 120ms var(--adwaita-spring);
}
.ms-cell:hover { background: linear-gradient(160deg, #6a738d, #474f66); }
.ms-cell:active { transform: scale(0.94); }
.ms-cell.open {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.05);
  cursor: default;
}
.ms-cell.open:hover { background: rgba(255, 255, 255, 0.07); }
.ms-cell.flag { background: linear-gradient(160deg, #b3641e, #7d3f0d); }
.ms-cell.mine { background: linear-gradient(160deg, #e8483c, #a01f18); }
.ms-cell.revealed { opacity: 0.55; }
.ms-cell.n1 { color: #6fb5ff; }
.ms-cell.n2 { color: #6fe08a; }
.ms-cell.n3 { color: #ff8f8f; }
.ms-cell.n4 { color: #b58cff; }
.ms-cell.n5 { color: #ffb066; }
.ms-cell.n6 { color: #66e0d6; }
.ms-cell.n7 { color: #ffffff; }
.ms-cell.n8 { color: #b9bec9; }

/* ============================================================
   4. ADVANCED FILE MANAGER — drop bar, actions and preview modal
   ============================================================ */
.file-dropbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card-bg-2);
  border-bottom: 1px solid transparent;
  transition: max-height 200ms var(--gnome-ease), padding 200ms var(--gnome-ease), border-color 200ms ease;
}
.file-dropbar.active {
  max-height: 34px;
  padding: 8px 12px;
  border-bottom-color: var(--window-border);
}
.file-dropbar-target { font-weight: 700; color: var(--accent); }

.file-item.dragging { opacity: 0.4; }
.file-item.drop-hover,
.crumb.drop-hover,
.file-list.drop-hover {
  background: var(--accent-soft) !important;
  box-shadow: 0 0 0 2px var(--accent) inset;
}
.file-preview-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--window-border);
  margin-top: auto;
}
.file-preview-actions .toolbar-button { flex: 1; min-width: 0; font-size: 11.5px; padding: 0 8px; }
.file-preview-actions .toolbar-button:disabled { opacity: 0.42; cursor: not-allowed; }

.preview-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 940;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 16, 0.68);
  backdrop-filter: blur(10px);
  animation: fade-in 180ms ease;
}
.preview-modal-overlay.closing { animation: fade-out 180ms ease forwards; }
@keyframes fade-out { to { opacity: 0; } }

.preview-modal {
  width: min(680px, 86vw);
  max-height: 82vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--window-border);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: pop-in 220ms var(--gnome-ease);
}
.preview-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--window-header);
  border-bottom: 1px solid var(--window-border);
}
.preview-modal-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-modal-close {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
  color: var(--muted);
  flex: 0 0 26px;
}
.preview-modal-close:hover { background: var(--surface-3); color: var(--text); }
.preview-modal-body {
  overflow: auto;
  padding: 20px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.02) 75%) 0 0 / 22px 22px,
    var(--window-bg);
}
.preview-modal-art { display: grid; place-items: center; min-height: 220px; }
.preview-modal-art svg { width: min(420px, 100%); height: auto; }
.preview-modal-text {
  margin: 0;
  font-family: "Source Code Pro", "Consolas", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.preview-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--window-border);
  background: var(--card-bg-2);
  font-size: 11.5px;
  color: var(--muted);
}

/* ============================================================
   NEXT-LEVEL MECHANICS — widgets, snap, overview, wifi, toasts
   ============================================================ */
body.overview-active .windows-layer {
  z-index: 470;
}
body.overview-active .window.overview-tile {
  pointer-events: auto;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  outline: 2px solid rgba(255, 255, 255, 0.28);
}
body.overview-active .window.overview-tile:hover {
  outline-color: #fff;
}
.window.overview-tile {
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), outline 180ms ease;
}

.wifi-scan-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 6px 8px 8px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--window-border);
  font-size: 12px;
}
.wifi-scan-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  color: var(--text);
}
.wifi-scan-row.searching { color: var(--muted); }
.wifi-scan-row.active { background: var(--accent-soft); }

.desktop-widgets {
  position: absolute;
  inset: var(--panel-height) 0 90px 0;
  z-index: 18;
  pointer-events: none;
}
.desktop-widget {
  position: absolute;
  pointer-events: auto;
  width: 220px;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(20, 24, 32, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  cursor: grab;
}
body.theme-light .desktop-widget {
  background: rgba(255, 255, 255, 0.52);
  color: #1d1d20;
}
.desktop-widget.dragging { cursor: grabbing; z-index: 50; }
.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.78;
  margin-bottom: 8px;
}
.widget-close {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-size: 12px;
  line-height: 1;
}
.widget-clock-digital { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.widget-clock-date { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.widget-analog {
  width: 108px; height: 108px;
  margin: 8px auto 4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.18), rgba(0,0,0,0.18));
}
.widget-hand {
  position: absolute;
  left: 50%; top: 50%;
  transform-origin: 50% 100%;
  background: #fff;
  border-radius: 999px;
}
.widget-hand.hour { width: 4px; height: 28px; margin: -28px 0 0 -2px; }
.widget-hand.minute { width: 3px; height: 38px; margin: -38px 0 0 -1.5px; }
.widget-hand.second { width: 2px; height: 42px; margin: -42px 0 0 -1px; background: var(--accent); }
.widget-weather-temp { font-size: 32px; font-weight: 800; }
.widget-weather-desc { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.widget-weather-meta { font-size: 11px; opacity: 0.7; margin-top: 8px; }
.widget-note {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  background: transparent;
  border: 0;
  color: inherit;
  font: 13px/1.45 "Segoe UI", system-ui, sans-serif;
  outline: none;
}
.notifications-layer .notification {
  box-shadow: var(--shadow-3);
}
.qs-tile.searching { opacity: 0.72; }

/* Standard system cursors (no custom SVG overrides). */
html,
body {
  cursor: default;
}

button,
.dock-item,
a,
[role="button"],
[data-action],
[data-app],
.window-header,
.window-control,
.window-menu-button,
.app-launcher,
.desktop-icon,
.editor-tab,
.calendar-quick-btn,
.power-action,
.desktop-widget,
.file-item,
.app-grid button {
  cursor: pointer;
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
textarea,
[contenteditable="true"],
.editor-area,
.sticky-text {
  cursor: text;
}

.qs-slider,
input[type="range"],
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

.window-resize-handle { cursor: nwse-resize; }
.window-resize-handle.nesw { cursor: nesw-resize; }
