/* Workspace navigation overlays the desktop; opening it never changes window geometry. */
.sidebar-backdrop {
  position: absolute;
  inset: var(--menu-height, 28px) 0 0;
  z-index: 1250;
  background: rgb(25 19 35 / 14%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: sidebar-backdrop-in .18s ease both;
}

.workspace-sidebar {
  --sidebar-text: #302e37;
  --sidebar-secondary: #89848f;
  --sidebar-hover: rgb(57 44 72 / 6%);
  --sidebar-active: rgb(85 65 111 / 11%);
  position: absolute;
  top: calc(var(--menu-height, 28px) + 8px);
  bottom: 10px;
  left: 8px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 15px;
  background: rgb(249 248 251 / 93%);
  color: var(--sidebar-text);
  box-shadow: 0 20px 65px -18px rgb(21 12 34 / 40%), 0 0 0 .5px rgb(27 17 38 / 10%);
  backdrop-filter: blur(36px) saturate(1.35);
  -webkit-backdrop-filter: blur(36px) saturate(1.35);
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(-100% - 16px));
  transition: transform .22s var(--ease, ease), opacity .18s ease, visibility 0s linear .22s;
  pointer-events: none;
}

.workspace-sidebar.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: transform .22s var(--ease, ease), opacity .18s ease, visibility 0s;
  pointer-events: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 18px 17px 13px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-brand > .ui-icon { color: #6d5a7a; flex-shrink: 0; }
.sidebar-brand strong { display: block; font-size: 16px; font-weight: 650; line-height: 1.2; letter-spacing: -.35px; }
.sidebar-brand small { display: block; margin-top: 3px; color: var(--sidebar-secondary); font-size: 13px; line-height: 1.3; }
.sidebar-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 5px; border-radius: 7px; color: var(--sidebar-secondary); flex-shrink: 0; }
.sidebar-close:hover { color: var(--sidebar-text); background: var(--sidebar-hover); }

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 0 10px;
  min-height: 35px;
  border: 1px solid rgb(48 36 64 / 9%);
  border-radius: 8px;
  background: rgb(255 255 255 / 58%);
  color: var(--sidebar-secondary);
  flex-shrink: 0;
}

.sidebar-search input {
  width: 100%;
  min-width: 0;
  height: 33px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 12px;
  line-height: 1.4;
}

.sidebar-search input::placeholder { color: #96909e; }
.sidebar-search:focus-within { border-color: rgb(106 87 132 / 45%); box-shadow: 0 0 0 2px rgb(106 87 132 / 10%); }
.sidebar-search input:focus-visible { outline: none; }
.sidebar-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 12px; scrollbar-width: thin; scrollbar-color: rgb(82 67 102 / 20%) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgb(82 67 102 / 20%); border-radius: 5px; }
.sidebar-section + .sidebar-section { margin-top: 17px; }
.sidebar-heading { margin: 8px 8px 7px; color: var(--sidebar-secondary); font-size: 12px; font-weight: 650; line-height: 1.4; letter-spacing: .65px; text-transform: uppercase; }
.sidebar-folders { display: grid; gap: 2px; }

.sidebar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 35px;
  padding: 8px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 450;
  line-height: 1.35;
  text-align: left;
}

.sidebar-row > .ui-icon { flex-shrink: 0; color: #877a91; }
.sidebar-row:hover, .sidebar-app:hover { background: var(--sidebar-hover); }
.sidebar-row[aria-current="page"], .sidebar-row.is-active, .sidebar-app.is-active { background: var(--sidebar-active); }
.sidebar-row[aria-current="page"] > .ui-icon { color: #655176; }
.sidebar-apps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 4px; }

.sidebar-app {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 7px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.3;
  text-align: left;
}

.sidebar-app > .canopy-app-icon { width: 28px; height: 28px; flex: 0 0 28px; }
.sidebar-app > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sidebar-layouts { display: flex; gap: 7px; padding: 2px 7px 0; }
.sidebar-layouts button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 34px; padding: 7px 10px; flex: 1; border: 1px solid rgb(48 36 64 / 9%); border-radius: 8px; color: var(--sidebar-text); background: rgb(255 255 255 / 40%); font-size: 13px; }
.sidebar-layouts button:hover { background: var(--sidebar-hover); }
.sidebar-layouts button[aria-pressed="true"], .sidebar-layouts button.active { border-color: rgb(106 87 132 / 28%); background: var(--sidebar-active); }
.sidebar-empty { margin: 16px 8px; color: var(--sidebar-secondary); font-size: 12px; line-height: 1.6; }
.sidebar-footer { display: grid; gap: 2px; flex-shrink: 0; padding: 10px; border-top: 1px solid rgb(49 35 65 / 8%); background: rgb(255 255 255 / 28%); }
.sidebar-footer .sidebar-row { min-height: 34px; }
.sidebar-toggle[aria-expanded="true"] { background: rgb(44 24 49 / 15%); }
.desktop-shell .menu-left .menu-item.sidebar-toggle { display: inline-flex !important; width: 29px; padding: 0 5px; margin-right: 5px; }
.workspace-sidebar button:focus-visible { outline: 2px solid #827092; outline-offset: -2px; }

.desktop-shell[data-theme="dark"] .workspace-sidebar {
  --sidebar-text: #edeaf1;
  --sidebar-secondary: #a6a0ae;
  --sidebar-hover: rgb(242 232 255 / 7%);
  --sidebar-active: rgb(213 195 232 / 14%);
  background: rgb(40 37 47 / 94%);
  border-color: rgb(255 255 255 / 12%);
}

.desktop-shell[data-theme="dark"] .sidebar-brand > .ui-icon,
.desktop-shell[data-theme="dark"] .sidebar-row > .ui-icon { color: #b5a5c3; }
.desktop-shell[data-theme="dark"] .sidebar-search { background: rgb(0 0 0 / 13%); border-color: rgb(255 255 255 / 9%); }
.desktop-shell[data-theme="dark"] .sidebar-footer { background: rgb(0 0 0 / 8%); border-color: rgb(255 255 255 / 8%); }
.desktop-shell[data-theme="dark"] .sidebar-layouts button { background: rgb(255 255 255 / 4%); border-color: rgb(255 255 255 / 10%); }

@keyframes sidebar-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) { .workspace-sidebar { width: min(320px, calc(100vw - 24px)); bottom: 8px; } .sidebar-header { min-height: 70px; } }
@media (max-height: 560px) { .sidebar-header { min-height: 58px; padding-top: 12px; padding-bottom: 9px; } .sidebar-search { margin-bottom: 8px; } .sidebar-footer { padding-top: 6px; padding-bottom: 6px; } }
@media (prefers-reduced-motion: reduce) { .workspace-sidebar, .sidebar-backdrop { animation: none; transition: none; } }
.reduced-motion .workspace-sidebar, .reduced-motion .sidebar-backdrop { animation: none; transition: none; }
