/* My Workspace (desktop-like UI)
 * Page-only CSS: MUST NOT affect other pages.
 * Uses existing global CSS variables where possible.
 */

.my-workspace {
  height: calc(100vh - 0px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  color: var(--text-primary);
  --mw-maximize-gap: 30px;
  /* Keep maximized windows above the taskbar visually */
  --mw-taskbar-safe-bottom: 86px;
  --mw-sidebar-w: 320px;
  --mw-canvas-wallpaper: none;
  --mw-sidebar-wallpaper: none;
  --mw-canvas-wp-overlay: rgba(0, 0, 0, 0);
  --mw-sidebar-wp-overlay: rgba(0, 0, 0, 0);
  --mw-canvas-wp-size: cover;
  --mw-canvas-wp-pos: center;
  --mw-sidebar-wp-size: cover;
  --mw-sidebar-wp-pos: center;
}

/* iOS Safari: prevent native long-press callout interfering with our menus */
body.my-workspace-page .my-workspace .mw-icon,
body.my-workspace-page .my-workspace .mw-tree-item,
body.my-workspace-page .my-workspace .mw-breadcrumb {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Page-scoped override: reduce base wrapper padding for this page only */
body.my-workspace-page .page-content-wrapper {
  padding: 2px !important;
}

/* Approved glass style (DO NOT MODIFY) */
.glass-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 20px 10px rgba(255, 255, 255, 1);
  position: relative;
  overflow: hidden;
}

/* Theme-scoped icon neutrals (avoid low contrast in light mode) */
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) {
  --mw-file-text: #475569;    /* slate-600 */
  --mw-file-default: #334155; /* slate-700 */
  --ws-viewer-media-bg: #ffffff;
}
body.my-workspace-page[data-theme="dark"],
body.my-workspace-page.dark-mode {
  --mw-file-text: #94A3B8;    /* slate-400 */
  --mw-file-default: #CBD5E1; /* slate-300 */
  --ws-viewer-media-bg: #000000;
}

/* Dark-mode tuning: reduce excessive white "glow" on glass surfaces.
 * Scope is page-only to avoid impacting other parts of the app.
 */
body.my-workspace-page[data-theme="dark"] .glass-card,
body.my-workspace-page.dark-mode .glass-card,
body[data-theme="dark"] .mw-menu.glass-card,
body.dark-mode .mw-menu.glass-card {
  background: rgba(18, 18, 18, 0.40);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 14px 46px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 16px 6px rgba(255, 255, 255, 0.10);
}
body.my-workspace-page[data-theme="dark"] .glass-card::before,
body.my-workspace-page.dark-mode .glass-card::before,
body[data-theme="dark"] .mw-menu.glass-card::before,
body.dark-mode .mw-menu.glass-card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
}

/* Dark-mode focus ring: text fields keep their normal border. */
body.my-workspace-page[data-theme="dark"] .form-control:focus,
body.my-workspace-page.dark-mode .form-control:focus {
  box-shadow: none !important;
  border-color: var(--border-color, rgba(255, 255, 255, 0.18)) !important;
}

body.my-workspace-page[data-theme="dark"] .form-select:focus,
body.my-workspace-page.dark-mode .form-select:focus {
  box-shadow: 0 0 0 0.18rem rgba(139, 92, 246, 0.30) !important;
  border-color: rgba(139, 92, 246, 0.55) !important;
}

/* Dark-mode hover surfaces: reduce "white flash" on dropzone-like blocks. */
body.my-workspace-page[data-theme="dark"] .mw-dropzone,
body.my-workspace-page.dark-mode .mw-dropzone {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.18);
}
body.my-workspace-page[data-theme="dark"] .mw-dropzone:hover,
body.my-workspace-page.dark-mode .mw-dropzone:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Dark-mode: inspector sits on top of wallpaper; give it a less transparent base
 * so content doesn't blend with the canvas background.
 */
body.my-workspace-page[data-theme="dark"] .mw-inspector.glass-card,
body.my-workspace-page.dark-mode .mw-inspector.glass-card {
  background: rgba(18, 18, 18, 0.85);
}

/* Light-mode overrides when mw-no-glass is enabled */
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .my-workspace.mw-no-glass .glass-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.12);
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .my-workspace.mw-no-glass .mw-menu {
  /* Start menu, context menu, wallpaper panel (all share `.mw-menu`) */
  background: var(--aira-surface-menu, #ffffff);
  border: 1px solid var(--aira-surface-border, #dee2e6);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Light-mode: keep Suite empty-state cards visually "glassy" (Aira / From Aira) */
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .my-workspace.mw-no-glass .mw-empty-hint-card.glass-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow:
    0 14px 42px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
}

/* Dev mode: temporarily disable glass visuals (revert by removing `.mw-no-glass` class) */
.my-workspace.mw-no-glass .glass-card {
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.35);
}

.my-workspace.mw-no-glass .glass-card::before {
  content: none;
  display: none;
}

.my-workspace.mw-no-glass .mw-menu {
  background: var(--aira-surface-menu, #ffffff);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--aira-surface-border, #dee2e6);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

/* Layout */
.mw-topbar {
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  min-height: 38px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.mw-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mw-pathbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.mw-pathbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mw-addressbar {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-addressbar {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.mw-title {
  display: none;
}

.mw-breadcrumb {
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-workspace .mw-secondary {
  color: var(--text-secondary);
}

.my-workspace .mw-crumb {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  max-width: 45vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-workspace .mw-crumb-ellipsis {
  pointer-events: none;
  cursor: default;
  opacity: 0.85;
}
.my-workspace .mw-crumb:hover { text-decoration: none; opacity: 0.9; }
.my-workspace .mw-crumb:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}
.my-workspace .mw-crumb-sep { opacity: 0.65; }

/* My Workspace: Aira "Ⓐ" badge optical sizing.
 * - Grid view: make it visually match 32px Bootstrap icons (which render heavier)
 * - List view: keep compact so row height doesn't inflate
 */
body.my-workspace-page .my-workspace .mw-icon-grid:not(.mw-list) .mw-icon .aira-suite-badge {
  /* Keep the same layout box as other 32px icons so labels align */
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 32px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px; /* match `.mw-icon i` spacing */
  /* The circled-A glyph sits low and renders lighter; scale + nudge optically. */
  transform: translateY(-2px) scale(1.45) !important;
  transform-origin: center;
}
body.my-workspace-page .my-workspace .mw-icon-grid.mw-list .mw-icon .aira-suite-badge {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 38px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-1px) scale(1.25) !important;
  transform-origin: center;
}

.mw-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mw-topbar-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 2px;
  border-radius: 1px;
}

.mw-icon-btn[disabled],
.mw-icon-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.mw-icon-btn[disabled]:hover,
.mw-icon-btn.disabled:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mw-float-card {
  position: fixed;
  right: 14px;
  bottom: 74px; /* above taskbar */
  width: 320px;
  max-width: calc(100vw - 28px);
  z-index: 1200;
  padding: 10px;
}
.mw-float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.mw-float-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  min-width: 0;
}
.mw-float-close {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.mw-dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
}
.mw-dropzone:hover { background: rgba(255, 255, 255, 0.10); }
.mw-dropzone.dragover {
  border-color: rgba(139, 92, 246, 0.9);
  background: rgba(139, 92, 246, 0.14);
}
.mw-dropzone:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.55);
  outline-offset: 2px;
}
.mw-dropzone-title {
  font-weight: 600;
  font-size: 0.92rem;
}

/* Wallpaper panel */
.mw-wallpaper-panel {
  position: fixed;
  right: 14px;
  bottom: 74px; /* above taskbar */
  width: 520px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 120px);
  z-index: 1300;
  padding: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}
.mw-wp-mobile-tabs {
  display: none;
  gap: 8px;
  margin: 8px 0 10px;
}
.mw-wp-mobile-tab {
  appearance: none;
  flex: 1 1 0%;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
}
.mw-wp-mobile-tab.active {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.18);
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-wp-mobile-tab {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.72);
}
.mw-wallpaper-slideshow {
  margin: 8px 0 10px;
  /* Wrapper has no padding; the inner row matches item height */
  padding: 0;
  border: none;
  background: transparent;
}
.mw-wp-slide-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}
.mw-wp-slide-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: inherit;
  font-size: inherit;
  min-width: 0;
}
.mw-wp-slide-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.mw-wp-pill-toggle {
  flex: 0 0 auto;
  min-width: 58px;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
}
.mw-wallpaper-panel.mw-menu {
  display: block; /* actual visibility is controlled inline by JS */
}
.mw-wallpaper-body {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 12px;
  align-items: start;
  max-height: calc(100vh - 190px);
}
.mw-wallpaper-divider {
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.14);
}
.mw-wallpaper-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mw-wallpaper-col-title {
  font-weight: inherit;
  font-size: inherit;
  margin-bottom: 8px;
}
.mw-wallpaper-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mw-wallpaper-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.mw-wallpaper-item:hover {
  background: rgba(255, 255, 255, 0.10);
}
.mw-wallpaper-item.active {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.14);
}
.mw-wallpaper-group-title {
  margin: 10px 8px 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.8;
  text-transform: uppercase;
  pointer-events: none;
}

.mw-wp-acc {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.mw-wp-acc > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mw-wp-acc > summary::-webkit-details-marker { display: none; }
.mw-wp-acc-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: inherit;
  font-size: inherit;
}
.mw-wp-acc-sub {
  font-size: 0.82rem;
  opacity: 0.8;
}
.mw-wp-acc-body {
  /* Override native <details> collapsing to enable smooth transitions */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 220ms ease, padding 220ms ease, opacity 140ms ease;
  will-change: max-height;
}
.mw-wp-acc[open] > .mw-wp-acc-body {
  padding: 0 10px 10px;
  max-height: 300px; /* ~6 items */
  overflow: auto;
  opacity: 1;
}

.mw-wp-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}
.mw-wp-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-radius: 999px;
  height: 24px;
  padding: 0 10px;
  font-size: inherit;
  font-weight: inherit;
  line-height: 24px;
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
}
.mw-wp-pill.active {
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.14);
}
.mw-wp-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mw-dropzone-sub {
  margin-top: 2px;
  font-size: 0.82rem;
  opacity: 0.8;
}
.mw-upload-status {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
}

.mw-toasts {
  position: fixed;
  right: 14px;
  bottom: 74px; /* above taskbar */
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.mw-toast {
  pointer-events: auto;
  width: 340px;
  max-width: calc(100vw - 28px);
  padding: 10px 10px;
}
.mw-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.mw-toast-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 0;
}
.mw-toast-msg {
  font-size: 0.86rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.mw-toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.mw-toast-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-primary);
  font-size: 0.84rem;
}
.mw-toast-btn:hover { background: rgba(255, 255, 255, 0.14); }
.mw-toast--error .mw-toast-title i { color: #EF4444; }
.mw-toast--warn .mw-toast-title i { color: #F59E0B; }
.mw-toast--success .mw-toast-title i { color: #22C55E; }
.mw-toast--info .mw-toast-title i { color: #60A5FA; }

.mw-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* Light-mode: avoid "everything goes dark" feeling */
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-confirm-overlay {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mw-confirm {
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.mw-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.mw-confirm-title {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.mw-confirm-body {
  color: var(--text-primary);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mw-confirm-msg {
  font-size: 0.9rem;
  flex-shrink: 0;
  overflow-wrap: anywhere;
}
.mw-confirm-details {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(46vh, 320px);
}
.mw-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0;
}
.mw-confirm-danger {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.10);
}
.mw-confirm-danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* Post-upload: inline prompt inside the Upload floating card (no backdrop/modal) */
#mwUploadCard .mw-upload-aira {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) #mwUploadCard .mw-upload-aira {
  border-top: 1px solid rgba(15, 23, 42, 0.10);
}
#mwUploadCard .mw-upload-aira-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
#mwUploadCard .mw-upload-aira-title {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-width: 0;
}
#mwUploadCard .mw-upload-aira-title-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
}
#mwUploadCard .mw-upload-aira-msg {
  font-size: 0.84rem;
  color: var(--text-secondary);
}
#mwUploadCard .mw-upload-aira-options {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#mwUploadCard .mw-upload-aira-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  user-select: none;
  cursor: pointer;
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) #mwUploadCard .mw-upload-aira-row {
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.03);
}
#mwUploadCard .mw-upload-aira-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
#mwUploadCard .mw-upload-aira-left i {
  font-size: 1.0rem;
  opacity: 0.95;
}
#mwUploadCard .mw-upload-aira-name {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mwUploadCard .mw-upload-aira-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
#mwUploadCard .mw-upload-aira-actions .mw-toast-btn {
  height: 32px;
  border-radius: 12px;
}
#mwUploadCard .mw-upload-aira-actions .mw-toast-btn.primary {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.14);
}
#mwUploadCard .mw-upload-aira-actions .mw-toast-btn.primary:hover {
  background: rgba(139, 92, 246, 0.20);
}
#mwUploadCard .mw-upload-aira-actions .mw-toast-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Share panel (native) */
.mw-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 1350;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mw-share-card {
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 12px;
}
.mw-share-body {
  padding: 2px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Analysis panel (native) */
.mw-analysis-overlay {
  position: fixed;
  inset: 0;
  z-index: 1350;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mw-analysis-card {
  width: 760px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 12px;
}
.mw-analysis-body {
  padding: 2px 4px 10px;
}

/* Magic panel (native) */
.mw-magic-overlay {
  position: fixed;
  inset: 0;
  z-index: 1350;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mw-magic-card {
  width: 760px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 12px;
}
.mw-magic-body {
  padding: 2px 4px 10px;
}
.mw-magic-result {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px;
  white-space: pre-wrap;
  color: var(--text-primary);
}
.mw-magic-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.mw-analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 8px 0 10px;
}
.mw-analysis-stat {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 10px 12px;
}
.mw-analysis-stat .k {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.mw-analysis-stat .v {
  margin-top: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.mw-analysis-section-title {
  margin-top: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}
.mw-analysis-details {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 10px 12px;
}
.mw-analysis-details summary {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  list-style: none;
}
.mw-analysis-details summary::-webkit-details-marker { display: none; }
.mw-analysis-details summary .mw-secondary { font-weight: 600; }
.mw-analysis-cols {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mw-analysis-colbox {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 0;
}
.mw-analysis-colbox .mw-secondary { font-size: 0.82rem; }
.mw-analysis-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  color: var(--text-primary);
  margin: 4px 6px 0 0;
}
.mw-analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.86rem;
}
.mw-analysis-table th,
.mw-analysis-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.mw-analysis-table th {
  color: var(--text-secondary);
  font-weight: 800;
}
.mw-share-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-share-top {
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.03);
}
.mw-share-public {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  user-select: none;
}
.mw-share-hint {
  font-size: 0.84rem;
  color: var(--text-secondary);
}
.mw-share-help {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.86rem;
  color: var(--text-secondary);
}
.mw-share-help b { color: var(--text-primary); }

.mw-share-add {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 10px 12px;
}
.mw-share-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "field field"
    "edit btn";
  gap: 10px;
  align-items: center;
}
.mw-share-field {
  min-width: 0;
  grid-area: field;
}
.mw-share-label {
  font-weight: 800;
  font-size: 0.86rem;
  margin-bottom: 6px;
}
.mw-share-user { position: relative; }
.mw-share-subhint {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.mw-share-edit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-primary);
  user-select: none;
  padding-bottom: 0;
  grid-area: edit;
}
.mw-share-add-btn {
  height: 34px;
  justify-self: end;
  grid-area: btn;
  min-width: 96px;
}
.mw-share-error {
  margin-top: 8px;
  color: #FCA5A5;
  font-size: 0.84rem;
}

.mw-share-list-head {
  margin-top: 0;
}
.mw-share-list {
  margin-top: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
  min-height: 52px;
  /* Show up to ~5 rows, then scroll inside this area (not the whole modal) */
  max-height: min(260px, calc(100vh - 360px));
  overflow: auto;
}

.mw-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
}
.mw-share-row + .mw-share-row {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.mw-share-row-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mw-share-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}
.mw-share-perm {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.mw-share-perm.is-edit {
  border-color: rgba(139, 92, 246, 0.38);
  background: rgba(139, 92, 246, 0.14);
}
.mw-share-perm.is-view {
  opacity: 0.95;
}

.my-workspace #mwShareUserResults {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1360;
  background: rgba(18, 18, 18, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
}
.my-workspace #mwShareUserResults .list-group-item {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.10);
}
.my-workspace #mwShareUserResults .list-group-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 720px) {
  /* Mobile: maximize windows should feel full-screen */
  .my-workspace {
    --mw-maximize-gap: 10px;
    --mw-taskbar-safe-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }

  .mw-share-add-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "field"
      "edit"
      "btn";
  }
  .mw-share-add-btn {
    justify-self: stretch;
  }

  /* Mobile topbar: 2-row layout (left row: nav+breadcrumb, right row: actions) */
  .mw-topbar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 8px 10px;
  }
  .mw-topbar-left,
  .mw-topbar-right {
    width: 100%;
  }
  .mw-topbar-right {
    gap: 8px;
    flex-wrap: nowrap;
  }
  .mw-topbar-sep {
    display: none;
  }

  /* Mobile: keep only key actions visible (others in "More") */
  #mwCutBtn,
  #mwCopyBtn,
  #mwPasteBtn,
  #mwRenameBtn,
  #mwShareBtn,
  #mwDeleteBtn,
  #mwInspectorToggleBtn {
    display: none !important;
  }
  #mwMoreBtn {
    display: inline-flex;
  }

  /* Mobile: when search is expanded, hide other actions to prevent wrapping */
  .mw-topbar.mw-search-open .mw-topbar-right > :not(#mwSearchWrap) {
    display: none !important;
  }
  .mw-topbar.mw-search-open #mwSearchWrap {
    width: 100%;
  }
  .mw-topbar.mw-search-open .mw-search.expanded {
    width: 100%;
  }
  .mw-topbar.mw-search-open .mw-search.expanded input {
    max-width: 100%;
  }

  /* Mobile wallpaper panel: bottom-sheet + segmented toggle (keeps two-target concept) */
  .mw-wp-mobile-tabs {
    display: flex;
  }
  .mw-wallpaper-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 100px);
  }
  .mw-wallpaper-body {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: calc(100vh - 240px);
  }
  .mw-wallpaper-divider {
    display: none;
  }
  .mw-wallpaper-col {
    display: none;
  }
  .mw-wallpaper-panel[data-wp-pane="sidebar"] .mw-wallpaper-col--sidebar,
  .mw-wallpaper-panel[data-wp-pane="canvas"] .mw-wallpaper-col--canvas {
    display: flex;
  }
}

.mw-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  height: 34px; /* match icon button */
  max-height: 34px;
  overflow: hidden;
  width: 34px; /* collapsed */
  transition: width 160ms ease, padding 160ms ease;
}
.mw-search .mw-search-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 0;
  background: transparent;
}
.mw-search i { opacity: 0.9; }
.mw-search input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  max-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: max-width 160ms ease, opacity 160ms ease;
  opacity: 0;
  pointer-events: none;
}
.mw-search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.mw-search.expanded {
  padding-right: 10px;
  width: 250px;
}
.mw-search.expanded input {
  max-width: 220px;
  opacity: 1;
  pointer-events: auto;
}

.mw-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.mw-user-text {
  font-size: 0.9rem;
}

.mw-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, transform 120ms ease;
}

/* Overflow button is desktop-hidden by default (mobile shows it via @media rules). */
@media (min-width: 721px) {
  #mwMoreBtn { display: none; }
}

.mw-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mw-icon-btn:active {
  transform: translateY(1px);
}

.mw-body {
  flex: 1 1 0%;
  display: grid;
  grid-template-columns: var(--mw-sidebar-w, 320px) 1fr;
  gap: 8px;
  min-height: 0;
  transition: grid-template-columns 180ms ease, gap 180ms ease;
  overflow: hidden;
  position: relative;
}

/* Sidebar resize should be 1:1 with pointer (no easing lag). */
.my-workspace.mw-sidebar-resizing .mw-body {
  transition: none !important;
}

.mw-inspector {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: min(360px, calc(100% - 16px));
  z-index: 45;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: transform 160ms ease, opacity 140ms ease;
}

.mw-inspector.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.mw-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-inspector-head {
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.mw-inspector-title {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mw-inspector-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mw-inspector-body {
  padding: 10px;
  overflow: auto;
  overflow-x: hidden;
  min-height: 0;
}

.mw-inspector-preview {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-inspector-preview {
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.03);
}

.mw-inspector-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mw-inspector-kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mw-inspector-kv .row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: baseline;
}

.mw-inspector-kv .k {
  color: var(--text-secondary);
  font-size: 13px;
}

.mw-inspector-kv .v {
  color: var(--text-primary);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mw-inspector-section-title {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  font-size: 13px;
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-inspector-section-title {
  border-top: 1px solid rgba(15, 23, 42, 0.10);
}

.mw-inspector-pin.is-pinned i {
  transform: rotate(-18deg);
}

.mw-inspector-acc {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-inspector-acc {
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.03);
}
.mw-inspector-acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
}
.mw-inspector-acc > summary::-webkit-details-marker { display: none; }
.mw-inspector-acc > summary::after {
  content: "▾";
  opacity: 0.75;
  font-weight: 700;
}
.mw-inspector-acc[open] > summary::after { content: "▴"; }
.mw-inspector-acc-body {
  padding: 8px 10px 10px;
}
.mw-inspector-share-list {
  max-height: 160px;
  overflow: auto;
  padding-right: 6px;
}
.mw-inspector-share-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 13px;
}
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-inspector-share-item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.mw-inspector-share-item:last-child { border-bottom: 0; }

.mw-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 10px;
  gap: 10px;
  z-index: 40;
  position: relative;
  transition: opacity 120ms ease;
}

.my-workspace.mw-explorer-collapsed {
  --mw-sidebar-w: 0px;
}

.mw-explorer-collapsed .mw-body {
  gap: 0;
}

.mw-explorer-collapsed .mw-sidebar {
  opacity: 0;
  pointer-events: none;
}

.mw-explorer-collapsed .mw-sidebar-resizer {
  display: none;
}

.mw-sidebar-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--mw-sidebar-wp-overlay, rgba(0, 0, 0, 0)), var(--mw-sidebar-wp-overlay, rgba(0, 0, 0, 0))),
    var(--mw-sidebar-wallpaper),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18), transparent 46%),
    radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.12), transparent 52%);
  background-size: cover, var(--mw-sidebar-wp-size, cover), auto, auto;
  background-position: center, var(--mw-sidebar-wp-pos, center), center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  transform: translateZ(0);
  opacity: 1;
}

.mw-sidebar-resizer {
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -6px; /* sits on the gap between columns */
  width: 12px;
  cursor: col-resize;
  z-index: 80;
  touch-action: none;
  user-select: none;
  background: transparent;
}

/* Visual resize line (only during active resize) */
.mw-sidebar.resizing::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: -1px;
  width: 3px;
  border-radius: 3px;
  background: #8B5CF6;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25);
  pointer-events: none;
}

/* Give a subtle hint on hover */
.mw-sidebar-resizer:hover::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

/* Sidebar resize on small screens is not needed */
@media (max-width: 991.98px) {
  .mw-body { grid-template-columns: 1fr; }
  .mw-sidebar-resizer { display: none; }
  .mw-explorer-collapsed .mw-sidebar { display: none; }
}

.mw-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
}

.mw-tabs-home {
  flex: 0 0 auto;
}

.mw-tabs-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.mw-tabs-scroll-inner {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px; /* keep active border from clipping */
}

.mw-tab {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 140ms ease, transform 120ms ease;
  user-select: none;
}

.mw-tab:hover { background: rgba(255, 255, 255, 0.13); }
.mw-tab:active { transform: translateY(1px); }
.mw-tab.active { background: rgba(255, 255, 255, 0.18); }

.mw-sidebar-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.mw-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
}

.mw-sidebar-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.mw-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mw-tree-section {
  display: flex;
  align-items: center;
  padding: 6px 8px 2px;
  color: var(--text-secondary);
  opacity: 0.9;
  user-select: none;
  pointer-events: none;
}

.mw-tree-section-text {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mw-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  cursor: default;
  user-select: none;
  color: var(--text-primary);
}

.mw-tree-item.selected {
  background: rgba(139, 92, 246, 0.18);
  border-radius: 10px;
}

.mw-tree-item:hover { background: rgba(255, 255, 255, 0.10); }
.mw-tree-item.active { background: rgba(255, 255, 255, 0.16); }
.mw-tree-item.drop-target { background: rgba(255, 255, 255, 0.22); }
.mw-tree-indent { width: calc(var(--i, 0) * 14px); flex: 0 0 auto; }

.mw-tree-item.mw-tree-file {
  opacity: 0.92;
}

.mw-tree-item.mw-tree-special-child {
  opacity: 0.95;
}
.mw-perm-lock {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-secondary);
  opacity: 0.85;
  font-size: 0.85em;
}
.mw-tree-item.mw-tree-file i {
  font-size: 0.95em;
}

/* Align Suite drive row with other drive icons */
.my-workspace .mw-tree-item.mw-tree-category-drive.mw-tree-suite-drive {
  padding-left: 6px;
}
.mw-tree-file-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-tree-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-tree-meta {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  opacity: 0.9;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-tree-meta {
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.45);
}

.mw-tree-rename-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 0.88rem;
  outline: none;
}

.mw-tree-rename-input:focus {
  border-color: rgba(255, 255, 255, 0.65);
}

.mw-canvas {
  position: relative;
  min-height: 0;
  overflow: hidden;
  outline: none;
}

.mw-canvas-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--mw-canvas-wp-overlay, rgba(0, 0, 0, 0)), var(--mw-canvas-wp-overlay, rgba(0, 0, 0, 0))),
    var(--mw-canvas-wallpaper),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18), transparent 46%),
    radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.12), transparent 52%);
  background-size: cover, var(--mw-canvas-wp-size, cover), auto, auto;
  background-position: center, var(--mw-canvas-wp-pos, center), center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  opacity: 1;
  pointer-events: none;
}

.mw-icon-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.mw-empty-hint {
  position: absolute;
  left: 14px;
  top: 14px;
  right: 14px;
  max-width: 560px;
  z-index: 2;
  pointer-events: none;
}

.mw-icon-grid.mw-list .mw-empty-hint {
  position: relative;
  left: auto;
  top: auto;
  right: auto;
  max-width: 100%;
  pointer-events: none;
}

.mw-empty-hint-card {
  padding: 14px 14px;
  border-radius: 14px;
}

.mw-empty-hint-title {
  font-weight: 650;
  margin-bottom: 6px;
}

.mw-empty-hint-text {
  color: var(--text-secondary);
  line-height: 1.35;
}

.mw-empty-hint-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  pointer-events: auto;
}
.mw-empty-hint-actions.drop-only {
  grid-template-columns: 1fr;
}

.mw-empty-dropzone {
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.mw-empty-dropzone:hover { background: rgba(255, 255, 255, 0.10); }
.mw-empty-dropzone.dragover {
  border-color: rgba(139, 92, 246, 0.75);
  background: rgba(139, 92, 246, 0.12);
}
.mw-empty-dropzone.disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.mw-empty-drop-icon i { font-size: 1.15rem; opacity: 0.95; }
.mw-empty-drop-text { font-weight: 650; }
.mw-empty-drop-sub { color: var(--text-secondary); font-size: 0.86rem; }

.mw-empty-create {
  display: flex;
  gap: 8px;
  align-items: stretch;
  justify-content: space-between;
  pointer-events: auto;
}
.mw-empty-create-btn {
  flex: 1 1 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  padding: 10px 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.mw-empty-create-btn i { font-size: 1.1rem; }
.mw-empty-create-btn span { font-size: 0.86rem; color: var(--text-secondary); }
.mw-empty-create-btn:hover { background: rgba(255, 255, 255, 0.10); }
.mw-empty-create-btn:active { transform: translateY(1px); }
.mw-empty-create-btn.disabled,
.mw-empty-create-btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 860px) {
  .mw-empty-hint-actions {
    grid-template-columns: 1fr;
  }
}

.mw-icon-grid.mw-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px;
  overflow: auto;
}

.mw-icon-grid.mw-list .mw-icon {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  text-align: left;
}

.mw-icon-grid.mw-list .mw-icon-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.mw-icon-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mw-icon-sub {
  font-size: 0.74rem;
  line-height: 1.1;
  color: var(--text-secondary);
  opacity: 0.92;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-icon-grid.mw-list .mw-icon-date {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 12px;
  min-width: 120px;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.mw-icon-grid.mw-list .mw-icon i {
  margin-bottom: 0;
}

.mw-icon-grid.mw-list .mw-icon-label {
  -webkit-line-clamp: 1;
  white-space: nowrap;
}

.mw-icon {
  position: absolute;
  width: 102px;
  padding: 10px 8px;
  border-radius: 14px;
  color: var(--text-primary);
  text-align: center;
  user-select: none;
  cursor: default;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.mw-icon-lock {
  position: absolute;
  right: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-secondary);
  opacity: 0.9;
  pointer-events: none;
}
.mw-icon .mw-icon-lock i {
  font-size: 1.2rem;
  line-height: 1;
  margin: 0;
}
.mw-icon .mw-file-aira-wait {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  z-index: 2;
  pointer-events: none;
}
.mw-icon .mw-file-aira-wait canvas {
  width: 28px;
  height: 28px;
  display: block;
}

.mw-icon.mw-dragging {
  pointer-events: none; /* allow hit-testing underlying targets during drag */
  opacity: 0.92;
}

body.mw-drag-active,
body.mw-drag-active * {
  cursor: grabbing !important;
}

.mw-icon.drop-target {
  background: rgba(139, 92, 246, 0.18);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

.mw-icon:hover {
  background: rgba(255, 255, 255, 0.10);
}

.mw-icon.selected {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.mw-icon-emoji,
.mw-icon i {
  font-size: 32px;
  line-height: 1;
  display: inline-block;
  margin-bottom: 6px;
}

/* Icon color rules (page-scoped) */
.my-workspace .mw-icon i.bi-hdd-stack,
.my-workspace .mw-tree-item i.bi-hdd-stack {
  color: #8B5CF6; /* categories */
  text-shadow:
    1px 0 0 rgba(255, 255, 255, 0.95),
    -1px 0 0 rgba(255, 255, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 -1px 0 rgba(255, 255, 255, 0.95);
}

.my-workspace .mw-icon i.bi-folder2,
.my-workspace .mw-icon i.bi-folder2-open,
.my-workspace .mw-tree-item i.bi-folder2,
.my-workspace .mw-tree-item i.bi-folder2-open {
  color: #FF8F35; /* folders */
}

.my-workspace .mw-icon i.bi-file-earmark-text,
.my-workspace .mw-tree-item i.bi-file-earmark-text {
  color: var(--mw-file-text);
}
.my-workspace .mw-icon i.bi-file-earmark,
.my-workspace .mw-tree-item i.bi-file-earmark {
  color: var(--mw-file-default);
}

/* File type icon colors (page-scoped) */
.my-workspace .mw-icon i.bi-filetype-pdf,
.my-workspace .mw-tree-item i.bi-filetype-pdf { color: #EF4444; }

.my-workspace .mw-icon i.bi-filetype-docx,
.my-workspace .mw-tree-item i.bi-filetype-docx { color: #2563EB; }

.my-workspace .mw-icon i.bi-filetype-pptx,
.my-workspace .mw-tree-item i.bi-filetype-pptx { color: #F97316; }

.my-workspace .mw-icon i.bi-filetype-xlsx,
.my-workspace .mw-tree-item i.bi-filetype-xlsx { color: #16A34A; }

.my-workspace .mw-icon i.bi-file-earmark-image,
.my-workspace .mw-tree-item i.bi-file-earmark-image { color: #A855F7; }

.my-workspace .mw-icon i.bi-file-earmark-play,
.my-workspace .mw-tree-item i.bi-file-earmark-play { color: #EC4899; }

.my-workspace .mw-icon i.bi-file-earmark-music,
.my-workspace .mw-tree-item i.bi-file-earmark-music { color: #06B6D4; }

.mw-icon-label {
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* When an icon is selected, show its full name (no ellipsis/clamp). */
.mw-icon.selected .mw-icon-label {
  overflow: visible;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  text-overflow: clip;
}

/* List view: keep it readable when selected. */
.mw-icon-grid.mw-list .mw-icon.selected .mw-icon-label {
  white-space: normal;
}

.mw-rename-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-primary);
  padding: 6px 8px;
  font-size: 0.86rem;
  outline: none;
}

.mw-rename-input:focus {
  border-color: rgba(255, 255, 255, 0.65);
}

.mw-rubberband {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  display: none;
  pointer-events: none;
}

.mw-taskbar {
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 10px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.mw-taskbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.mw-start-btn {
  width: 44px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mw-start-badge {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  line-height: 1;
  flex: 0 0 25px;
}

.mw-taskbar-windows {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-width: 0;
}

.mw-taskbar-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease;
  white-space: nowrap;
}

.mw-taskbar-item.active { background: rgba(255, 255, 255, 0.16); }

.mw-taskbar-right {
  display: inline-flex;
  gap: 8px;
}

.mw-tray-btn {
  width: 36px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Custom context menu */
.mw-menu {
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid var(--aira-surface-border, #dee2e6);
  background: var(--aira-surface-menu, #ffffff);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  padding: 8px;
  display: none;
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-menu {
  border: 1px solid var(--aira-surface-border, #dee2e6);
  background: var(--aira-surface-menu, #ffffff);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-menu-item:hover {
  background: var(--aira-surface-hover, #e9ecef);
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-menu-sep {
  background: var(--aira-surface-border, #dee2e6);
}

.mw-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
}

.mw-menu-item > span {
  flex: 1;
}

.mw-menu-app-icon {
  width: 22px;
  height: 20px;
  flex: 0 0 22px;
  object-fit: contain;
}

.mw-menu-item > i:not(.mw-menu-arrow),
.mw-menu-item > .assistant-toggle-btn {
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
}

.mw-menu-item > .assistant-toggle-btn {
  justify-content: center;
}

.mw-menu-brand {
  display: inline-flex;
  align-items: baseline;
}

.mw-menu-brand strong {
  font-weight: 800;
}

.mw-menu-brand span {
  font-weight: 400;
}

.mw-menu-item.has-submenu {
  padding-right: 8px;
}

.mw-menu-arrow {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.8;
}

.mw-submenu {
  z-index: 10000;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}

.mw-menu-item:hover {
  background: var(--aira-surface-hover, #e9ecef);
}

body[data-theme="dark"] .mw-menu .mw-menu-item:hover,
body.dark-mode .mw-menu .mw-menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mw-menu-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mw-menu-sep {
  height: 1px;
  margin: 6px 2px;
  background: var(--aira-surface-border, #dee2e6);
}

/* Desktop-wide application layer: fixed to the viewport and sized by JS to
   stop immediately above the taskbar. */
.mw-window-layer {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  overflow: visible;
  contain: layout;
}

/* Windows */
.mw-window {
  position: absolute;
  z-index: 10;
  min-width: min(320px, 100%);
  min-height: min(220px, 100%);
  width: 720px;
  height: 520px;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: auto;
  transform-origin: center center;
}

.mw-window.maximized {
  position: absolute;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
}

.mw-window.maximized .mw-resize-zone {
  display: none;
}

.mw-drag-ghost {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 20, 20, 0.92);
  color: var(--text-primary);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  font-size: 0.9rem;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .mw-drag-ghost {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.16);
}

/* Light-mode UI surfaces tuning */
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .my-workspace .mw-topbar.glass-card,
body.my-workspace-page:not([data-theme="dark"]):not(.dark-mode) .my-workspace .mw-taskbar.glass-card {
  background: #EAECEF;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.10);
}

.mw-canvas.drop-target {
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35) inset;
}

.mw-window .mw-winbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 0 12px;
}

.mw-win-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-win-actions {
  display: inline-flex;
  gap: 8px;
}

.mw-win-btn {
  width: 34px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.mw-restore-icon {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 12px;
}

.mw-restore-icon::before,
.mw-restore-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 8px;
  border-radius: 1px;
  box-sizing: border-box;
}

.mw-restore-icon::before {
  top: 1px;
  right: 0;
  border-top: 1.4px solid currentColor;
  border-right: 1.4px solid currentColor;
}

.mw-restore-icon::after {
  left: 0;
  bottom: 0;
  border: 1.4px solid currentColor;
}


.mw-win-body {
  height: calc(100% - 44px);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.mw-media-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
}

.mw-media-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.26);
  color: var(--text-primary);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
  opacity: 0.92;
}
.mw-media-nav-btn:hover {
  background: rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}
.mw-media-nav-btn:active {
  transform: translateY(0px);
}
.mw-media-nav-btn i {
  font-size: 1.15rem;
  line-height: 1;
}

.mw-win-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.mw-resize-zone {
  position: absolute;
  z-index: 6;
  display: block;
  touch-action: none;
  background: transparent;
}

.mw-resize-n,
.mw-resize-s {
  left: 12px;
  right: 12px;
  height: 7px;
}
.mw-resize-n { top: 0; cursor: ns-resize; }
.mw-resize-s { bottom: 0; cursor: ns-resize; }

.mw-resize-e,
.mw-resize-w {
  top: 12px;
  bottom: 12px;
  width: 7px;
}
.mw-resize-e { right: 0; cursor: ew-resize; }
.mw-resize-w { left: 0; cursor: ew-resize; }

.mw-resize-ne,
.mw-resize-nw,
.mw-resize-se,
.mw-resize-sw {
  width: 14px;
  height: 14px;
  z-index: 7;
}
.mw-resize-ne { top: 0; right: 0; cursor: nesw-resize; }
.mw-resize-nw { top: 0; left: 0; cursor: nwse-resize; }
.mw-resize-se { right: 0; bottom: 0; cursor: nwse-resize; }
.mw-resize-sw { left: 0; bottom: 0; cursor: nesw-resize; }

