/* ============================================================
   Modern UI for CopyParty — Google-Style Theme
   Zero dependencies, loaded via --css-browser
   ============================================================ */

/* ===== 1. DESIGN TOKENS ===== */
:root {
  --m-font: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --m-font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;

  /* Colors — Google Material Light */
  --m-primary: #1a73e8;
  --m-primary-hover: #1557b0;
  --m-primary-light: #e8f0fe;
  --m-primary-text: #ffffff;
  --m-surface: #ffffff;
  --m-surface-hover: #f1f3f4;
  --m-surface-active: #e8eaed;
  --m-bg: #f8f9fa;
  --m-text: #202124;
  --m-text-secondary: #5f6368;
  --m-text-tertiary: #80868b;
  --m-border: #dadce0;
  --m-border-light: #e8eaed;
  --m-shadow-sm: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --m-shadow-md: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --m-shadow-lg: 0 4px 8px 0 rgba(60,64,67,.3), 0 8px 16px 4px rgba(60,64,67,.15);
  --m-radius: 8px;
  --m-radius-lg: 12px;
  --m-radius-xl: 16px;
  --m-radius-full: 9999px;

  /* Semantic Colors */
  --m-error: #ea4335;
  --m-error-light: #fce8e6;
  --m-success: #34a853;
  --m-success-light: #e6f4ea;
  --m-warning: #fbbc05;
  --m-warning-light: #fef7e0;
  --m-info: #4285f4;
  --m-info-light: #e8f0fe;

  /* File type icon colors */
  --m-ft-folder: #5f6368;
  --m-ft-folder-bg: #e8eaed;
  --m-ft-pdf: #ea4335;
  --m-ft-pdf-bg: #fce8e6;
  --m-ft-doc: #4285f4;
  --m-ft-doc-bg: #e8f0fe;
  --m-ft-sheet: #34a853;
  --m-ft-sheet-bg: #e6f4ea;
  --m-ft-image: #4ecdc4;
  --m-ft-image-bg: #e0f7f5;
  --m-ft-video: #9c27b0;
  --m-ft-video-bg: #f3e5f5;
  --m-ft-audio: #ff6d00;
  --m-ft-audio-bg: #fff3e0;
  --m-ft-archive: #795548;
  --m-ft-archive-bg: #efebe9;
  --m-ft-code: #607d8b;
  --m-ft-code-bg: #eceff1;
  --m-ft-default: #9e9e9e;
  --m-ft-default-bg: #f5f5f5;

  /* Layout */
  --m-sidebar-w: 256px;
  --m-header-h: 64px;
  --m-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== DARK MODE ===== */
html.modern-dark {
  --m-primary: #8ab4f8;
  --m-primary-hover: #aecbfa;
  --m-primary-light: #1a3355;
  --m-primary-text: #202124;
  --m-surface: #2d2d2d;
  --m-surface-hover: #3c3c3c;
  --m-surface-active: #4a4a4a;
  --m-bg: #1f1f1f;
  --m-text: #e8eaed;
  --m-text-secondary: #9aa0a6;
  --m-text-tertiary: #80868b;
  --m-border: #3c4043;
  --m-border-light: #3c4043;
  --m-shadow-sm: 0 1px 3px 0 rgba(0,0,0,.5);
  --m-shadow-md: 0 2px 6px 0 rgba(0,0,0,.5);
  --m-shadow-lg: 0 4px 12px 0 rgba(0,0,0,.5);

  --m-error-light: #3b1c1a;
  --m-success-light: #1a3324;
  --m-warning-light: #3b3318;
  --m-info-light: #1a3355;

  --m-ft-folder-bg: #3c4043;
  --m-ft-pdf-bg: #3b1c1a;
  --m-ft-doc-bg: #1a3355;
  --m-ft-sheet-bg: #1a3324;
  --m-ft-image-bg: #1a3331;
  --m-ft-video-bg: #2c1533;
  --m-ft-audio-bg: #3b2a18;
  --m-ft-archive-bg: #2d231e;
  --m-ft-code-bg: #1e2b30;
  --m-ft-default-bg: #3c4043;
}

/* ===== 2. HIDE ORIGINAL UI WHEN MODERN IS ACTIVE ===== */
html.modern-active #acc_info,
html.modern-active #ops,
html.modern-active .opview,
html.modern-active #path,
html.modern-active #tree,
html.modern-active #wrap,
html.modern-active #srv_info,
html.modern-active #widget,
html.modern-active #rcm,
html.modern-active .dropdesc,
html.modern-active .dropzone,
html.modern-active #drops,
html.modern-active .ayjump,
html.modern-active #wfp,
html.modern-active h1#path,
html.modern-active h2#wfp {
  display: none !important;
}

html.modern-active body {
  background: var(--m-bg) !important;
  color: var(--m-text) !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--m-font) !important;
  text-shadow: none !important;
}

html.modern-active {
  color-scheme: light !important;
  background: var(--m-bg) !important;
  text-shadow: none !important;
}
html.modern-active.modern-dark {
  color-scheme: dark !important;
}

/* ===== 3. APP SHELL ===== */
#modern-app {
  display: flex;
  min-height: 100vh;
  background: var(--m-bg);
  color: var(--m-text);
  font-family: var(--m-font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

html:not(.modern-active) #modern-app {
  display: none !important;
}

/* ===== 4. SIDEBAR ===== */
.m-sidebar {
  width: var(--m-sidebar-w);
  min-width: var(--m-sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: var(--m-surface);
  border-right: 1px solid var(--m-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform var(--m-transition);
}

.m-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  min-height: var(--m-header-h);
  box-sizing: border-box;
}

.m-sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--m-radius);
  background: var(--m-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.m-sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--m-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-sidebar-subtitle {
  font-size: 11px;
  color: var(--m-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Upload Button */
.m-upload-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 16px;
  padding: 12px 20px;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-full);
  color: var(--m-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow var(--m-transition), background var(--m-transition);
  font-family: inherit;
  box-shadow: var(--m-shadow-sm);
}

.m-upload-btn:hover {
  box-shadow: var(--m-shadow-md);
  background: var(--m-surface-hover);
}

.m-upload-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--m-primary);
  stroke-width: 2;
}

/* Sidebar Nav */
.m-sidebar-nav {
  flex: 1;
  padding: 0 8px;
}

.m-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-radius: var(--m-radius-full);
  color: var(--m-text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--m-transition), color var(--m-transition);
  margin: 1px 0;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.m-nav-item:hover {
  background: var(--m-surface-hover);
  color: var(--m-text);
}

.m-nav-item.active {
  background: var(--m-primary-light);
  color: var(--m-primary);
  font-weight: 600;
}

.m-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.m-nav-divider {
  height: 1px;
  background: var(--m-border-light);
  margin: 8px 16px;
}

/* Storage Info */
.m-storage {
  padding: 16px 20px;
  border-top: 1px solid var(--m-border-light);
  margin-top: auto;
}

.m-storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--m-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.m-storage-bar {
  height: 4px;
  background: var(--m-border-light);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.m-storage-fill {
  height: 100%;
  background: var(--m-primary);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.m-storage-text {
  font-size: 12px;
  color: var(--m-text-secondary);
}

/* ===== 5. MAIN CONTENT ===== */
.m-main {
  flex: 1;
  margin-left: var(--m-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 6. HEADER ===== */
.m-header {
  height: var(--m-header-h);
  min-height: var(--m-header-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.m-hamburger {
  display: none;
  padding: 8px;
  border: none;
  background: none;
  border-radius: var(--m-radius-full);
  cursor: pointer;
  color: var(--m-text-secondary);
}
.m-hamburger:hover { background: var(--m-surface-hover); }

/* Search Bar */
.m-search {
  flex: 1;
  max-width: 720px;
  position: relative;
}

.m-search-input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  border: none;
  border-radius: var(--m-radius-full);
  background: var(--m-bg);
  color: var(--m-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: background var(--m-transition), box-shadow var(--m-transition);
  box-sizing: border-box;
}

.m-search-input:focus {
  background: var(--m-surface);
  box-shadow: var(--m-shadow-md);
}

.m-search-input::placeholder {
  color: var(--m-text-tertiary);
}

.m-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--m-text-tertiary);
}

/* Header Actions */
.m-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.m-header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--m-radius-full);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--m-text-secondary);
  transition: background var(--m-transition);
  padding: 0;
}

.m-header-btn:hover {
  background: var(--m-surface-hover);
}

.m-header-btn svg {
  width: 20px;
  height: 20px;
}

.m-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--m-radius-full);
  background: var(--m-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  transition: box-shadow var(--m-transition), transform var(--m-transition);
}
.m-user-avatar:hover {
  box-shadow: 0 0 0 3px var(--m-primary-light);
  transform: scale(1.05);
}

/* ===== 7. CONTENT AREA ===== */
.m-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1400px;
}

/* ===== 8. BREADCRUMBS ===== */
.m-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0 0 24px 0;
  list-style: none;
  font-size: 13px;
  flex-wrap: wrap;
}

.m-breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.m-breadcrumbs a {
  color: var(--m-text-secondary);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--m-radius);
  transition: background var(--m-transition), color var(--m-transition);
  font-weight: 500;
}

.m-breadcrumbs a:hover {
  background: var(--m-surface-hover);
  color: var(--m-primary);
}

.m-breadcrumbs .m-bc-current {
  color: var(--m-text);
  font-weight: 600;
  padding: 4px 8px;
}

.m-breadcrumbs .m-bc-sep {
  color: var(--m-text-tertiary);
  font-size: 16px;
  user-select: none;
}

.m-breadcrumbs .m-bc-sep svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* ===== 9. SECTION HEADER ===== */
.m-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.m-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--m-text);
  margin: 0;
}

.m-section-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--m-primary);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: var(--m-radius-full);
  transition: background var(--m-transition);
  cursor: pointer;
  border: 1px solid var(--m-border);
  background: var(--m-surface);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.m-section-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.m-section-action:hover {
  background: var(--m-primary-light);
  border-color: var(--m-primary);
}

/* ===== 10. FOLDER CARDS ===== */
.m-folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.m-folder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  text-decoration: none;
  color: var(--m-text);
  transition: background var(--m-transition), box-shadow var(--m-transition), border-color var(--m-transition);
  cursor: pointer;
  overflow: hidden;
}

.m-folder-card:hover {
  background: var(--m-surface-hover);
  border-color: var(--m-border);
  box-shadow: var(--m-shadow-sm);
}

.m-folder-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--m-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.m-folder-icon svg {
  width: 24px;
  height: 24px;
}

.m-folder-info {
  overflow: hidden;
  min-width: 0;
}

.m-folder-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-folder-meta {
  font-size: 11px;
  color: var(--m-text-tertiary);
  margin-top: 2px;
}

/* ===== 11. FILE LIST ===== */
.m-filelist {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-lg);
  overflow: hidden;
}

.m-filelist-header {
  display: grid;
  grid-template-columns: 48px minmax(200px, 1fr) 120px 100px 180px 48px;
  padding: 12px 20px;
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--m-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 12px;
  align-items: center;
}

.m-filelist-header > div {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  transition: color var(--m-transition);
}

.m-filelist-header > div:hover {
  color: var(--m-text);
}

.m-file-row {
  display: grid;
  grid-template-columns: 48px minmax(200px, 1fr) 120px 100px 180px 48px;
  padding: 10px 20px;
  align-items: center;
  gap: 12px;
  transition: background var(--m-transition);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--m-border-light);
}

.m-file-row:last-child {
  border-bottom: none;
}

.m-file-row:hover {
  background: var(--m-surface-hover);
}

.m-file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.m-file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--m-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.m-file-name-text {
  overflow: hidden;
}

.m-file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--m-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.m-file-name-link {
  color: var(--m-text);
  text-decoration: none;
}

.m-file-name-link:hover {
  color: var(--m-primary);
}

.m-file-type-label {
  font-size: 11px;
  color: var(--m-text-tertiary);
}

.m-file-size,
.m-file-ext,
.m-file-date {
  font-size: 13px;
  color: var(--m-text-secondary);
  white-space: nowrap;
}

.m-file-actions {
  display: flex;
  justify-content: flex-end;
}

.m-file-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--m-radius-full);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--m-text-tertiary);
  opacity: 0;
  transition: opacity var(--m-transition), background var(--m-transition);
  padding: 0;
}

.m-file-row:hover .m-file-action-btn {
  opacity: 1;
}

.m-file-action-btn:hover {
  background: var(--m-surface-active);
  color: var(--m-text);
}

/* ===== 12. EMPTY STATE ===== */
.m-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
}

.m-empty-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  color: var(--m-text-tertiary);
  opacity: 0.4;
}

.m-empty-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--m-text);
  margin-bottom: 8px;
}

.m-empty-text {
  font-size: 14px;
  color: var(--m-text-secondary);
  max-width: 400px;
}

/* ===== 13. MODAL ===== */
.m-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--m-transition);
}

.m-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.m-modal {
  background: var(--m-surface);
  border-radius: var(--m-radius-xl);
  padding: 24px;
  min-width: 400px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: var(--m-shadow-lg);
  transform: translateY(20px);
  transition: transform var(--m-transition);
}

.m-modal-overlay.active .m-modal {
  transform: translateY(0);
}

.m-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--m-text);
}

.m-modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--m-text);
  background: var(--m-bg);
  outline: none;
  transition: border-color var(--m-transition), box-shadow var(--m-transition);
  box-sizing: border-box;
  margin-bottom: 20px;
}

.m-modal-input:focus {
  border-color: var(--m-primary);
  box-shadow: 0 0 0 2px var(--m-primary-light);
}

.m-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.m-btn-primary {
  padding: 10px 24px;
  background: var(--m-primary);
  color: var(--m-primary-text);
  border: none;
  border-radius: var(--m-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--m-transition), box-shadow var(--m-transition);
}

.m-btn-primary:hover {
  background: var(--m-primary-hover);
  box-shadow: var(--m-shadow-sm);
}

.m-btn-secondary {
  padding: 10px 24px;
  background: none;
  color: var(--m-primary);
  border: none;
  border-radius: var(--m-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--m-transition);
}

.m-btn-secondary:hover {
  background: var(--m-primary-light);
}

/* ===== 14. UPLOAD STATUS TOAST ===== */
@keyframes m-pulse {
  0% { box-shadow: 0 0 0 0 rgba(138, 180, 248, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(138, 180, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(138, 180, 248, 0); }
}

.m-upload-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--m-surface);
  border-radius: var(--m-radius-lg);
  box-shadow: var(--m-shadow-lg);
  padding: 16px 20px;
  min-width: 300px;
  max-width: 400px;
  z-index: 900;
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--m-border);
}

.m-upload-toast.visible {
  transform: translateY(0);
}

.m-upload-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.m-upload-toast-title {
  font-size: 14px;
  font-weight: 600;
}

.m-upload-progress-bar {
  height: 4px;
  background: var(--m-border-light);
  border-radius: 2px;
  overflow: hidden;
}

.m-upload-progress-fill {
  height: 100%;
  background: var(--m-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.m-upload-progress-text {
  font-size: 12px;
  color: var(--m-text-secondary);
  margin-top: 6px;
}

/* ===== 15. UI TOGGLE ===== */
.m-toggle-ui {
  position: fixed;
  bottom: 80px;
  left: 24px;
  z-index: 9999;
  padding: 8px 16px;
  border-radius: var(--m-radius-full);
  border: 1px solid var(--m-border);
  background: var(--m-surface);
  color: var(--m-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--m-shadow-md);
  transition: all var(--m-transition);
  font-family: var(--m-font);
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-toggle-ui:hover {
  background: var(--m-surface-hover);
  color: var(--m-text);
  box-shadow: var(--m-shadow-lg);
}

/* Classic mode toggle */
html:not(.modern-active) .m-toggle-ui {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
}

/* ===== 16. CONTEXT MENU ===== */
.m-context-menu {
  position: fixed;
  z-index: 1100;
  background: var(--m-surface);
  border-radius: var(--m-radius-lg);
  box-shadow: var(--m-shadow-lg);
  border: 1px solid var(--m-border);
  padding: 4px 0;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 100ms, transform 100ms;
}

.m-context-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.m-ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--m-text);
  cursor: pointer;
  transition: background 80ms;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.m-ctx-item:hover {
  background: var(--m-surface-hover);
}

.m-ctx-item svg {
  width: 18px;
  height: 18px;
  color: var(--m-text-secondary);
  flex-shrink: 0;
}

.m-ctx-divider {
  height: 1px;
  background: var(--m-border-light);
  margin: 4px 0;
}

.m-ctx-item.danger {
  color: var(--m-error);
}
.m-ctx-item.danger svg {
  color: var(--m-error);
}

/* ===== 17. RESPONSIVE ===== */
@media (max-width: 900px) {
  .m-sidebar {
    transform: translateX(-100%);
  }
  .m-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--m-shadow-lg);
  }
  .m-main {
    margin-left: 0;
  }
  .m-hamburger {
    display: flex;
  }
  .m-content {
    padding: 16px;
  }
  .m-filelist-header,
  .m-file-row {
    grid-template-columns: minmax(150px, 1fr) 80px 160px 40px;
  }
  .m-file-ext {
    display: none;
  }
  .m-folders-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .m-filelist-header,
  .m-file-row {
    grid-template-columns: 1fr 40px;
  }
  .m-file-size,
  .m-file-ext,
  .m-file-date {
    display: none;
  }
  .m-filelist-header > div:nth-child(n+2):not(:last-child) {
    display: none;
  }
  .m-search { display: none; }
  .m-folder-card {
    padding: 10px 12px;
  }
}

/* Sidebar overlay on mobile */
.m-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

@media (max-width: 900px) {
  .m-sidebar-overlay.open {
    display: block;
  }
}

/* ===== 18. ANIMATIONS ===== */
@keyframes m-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.m-folder-card,
.m-file-row {
  animation: m-fade-in 0.3s ease forwards;
}

.m-folder-card:nth-child(1) { animation-delay: 0ms; }
.m-folder-card:nth-child(2) { animation-delay: 30ms; }
.m-folder-card:nth-child(3) { animation-delay: 60ms; }
.m-folder-card:nth-child(4) { animation-delay: 90ms; }
.m-folder-card:nth-child(5) { animation-delay: 120ms; }
.m-folder-card:nth-child(6) { animation-delay: 150ms; }
.m-folder-card:nth-child(n+7) { animation-delay: 180ms; }

/* ===== 19. SCROLLBAR ===== */
html.modern-active ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html.modern-active ::-webkit-scrollbar-track {
  background: transparent;
}
html.modern-active ::-webkit-scrollbar-thumb {
  background: var(--m-border);
  border-radius: 4px;
}
html.modern-active ::-webkit-scrollbar-thumb:hover {
  background: var(--m-text-tertiary);
}

/* ===== 20. MISC ===== */
.m-tooltip {
  position: relative;
}

.m-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--m-radius-full);
  font-size: 11px;
  font-weight: 600;
}

.m-badge-rw {
  background: var(--m-success-light);
  color: var(--m-success);
}

.m-badge-ro {
  background: var(--m-info-light);
  color: var(--m-info);
}

.m-perms-info {
  font-size: 12px;
  color: var(--m-text-tertiary);
  margin-left: 12px;
}

/* ===== 21. SORT INDICATORS ===== */
.m-sort-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.3;
}
.m-sort-indicator.active {
  opacity: 1;
  color: var(--m-primary);
}

/* ===== 22. SELECTION & CHECKBOXES ===== */
.m-checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--m-border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: var(--m-surface);
}

.m-checkbox.checked {
  background: var(--m-primary);
  border-color: var(--m-primary);
}

.m-checkbox svg {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.m-checkbox.checked svg {
  opacity: 1;
  transform: scale(1);
}

/* ===== 23. BATCH ACTION BAR (FIXED — not clipped) ===== */
.m-batch-action-bar {
  position: fixed;
  top: var(--m-header-h);
  left: var(--m-sidebar-w);
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 32px;
  background: var(--m-primary-light);
  border-bottom: 2px solid var(--m-primary);
  box-shadow: var(--m-shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.m-batch-action-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.m-batch-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--m-primary);
  margin-right: auto;
}

.m-batch-action-bar .m-btn-primary {
  padding: 8px 20px;
  font-size: 13px;
}
.m-batch-action-bar .m-btn-secondary {
  padding: 8px 20px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .m-batch-action-bar {
    left: 0;
  }
}

/* ===== 24. PREVIEW MODAL ===== */
.m-preview-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.m-preview-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.m-preview-close {
  position: absolute;
  top: 24px; right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2001;
}

.m-preview-close:hover {
  background: rgba(255,255,255,0.25);
}

.m-preview-close svg {
  width: 24px; height: 24px;
}

.m-preview-content-box {
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--m-radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.m-preview-img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  object-fit: contain;
}

.m-preview-text {
  background: var(--m-surface);
  color: var(--m-text);
  padding: 24px;
  min-width: 60vw;
  max-width: 90vw;
  max-height: 90vh;
  margin: 0;
  font-family: monospace;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
}

.m-preview-media {
  max-width: 90vw;
  max-height: 90vh;
  outline: none;
}

/* ===== 25. SETTINGS PANEL ===== */
.m-settings-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.m-settings-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.m-settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--m-surface);
  z-index: 1501;
  box-shadow: -4px 0 24px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.m-settings-panel.active {
  transform: translateX(0);
}

.m-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--m-border);
  min-height: 64px;
  box-sizing: border-box;
}

.m-settings-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--m-text);
}

.m-settings-close {
  width: 36px;
  height: 36px;
  border-radius: var(--m-radius-full);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--m-text-secondary);
  transition: background var(--m-transition);
}
.m-settings-close:hover {
  background: var(--m-surface-hover);
}
.m-settings-close svg {
  width: 20px;
  height: 20px;
}

.m-settings-body {
  padding: 16px 24px;
  flex: 1;
  overflow-y: auto;
}

.m-settings-section {
  margin-bottom: 28px;
}

.m-settings-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--m-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.m-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--m-border-light);
}
.m-setting-row:last-child {
  border-bottom: none;
}

.m-setting-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--m-text);
}

.m-setting-desc {
  font-size: 12px;
  color: var(--m-text-tertiary);
  margin-top: 2px;
}

/* Toggle Switch */
.m-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--m-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}
.m-switch.active {
  background: var(--m-primary);
}
.m-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.m-switch.active::after {
  transform: translateX(20px);
}

/* Color Swatches */
.m-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0;
}

.m-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}
.m-color-swatch:hover {
  transform: scale(1.15);
}
.m-color-swatch.active {
  border-color: var(--m-text);
  box-shadow: 0 0 0 2px var(--m-surface), 0 0 0 4px var(--m-text);
}
.m-color-swatch.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Settings Action Buttons */
.m-settings-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-surface);
  color: var(--m-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--m-transition);
  margin-bottom: 8px;
}
.m-settings-action-btn:hover {
  background: var(--m-surface-hover);
  border-color: var(--m-primary);
}
.m-settings-action-btn svg {
  width: 20px;
  height: 20px;
  color: var(--m-text-secondary);
}

.m-settings-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--m-border);
  text-align: center;
}
.m-settings-footer-text {
  font-size: 12px;
  color: var(--m-text-tertiary);
  line-height: 1.6;
}

/* ===== 26. LOGIN MODAL ===== */
.m-login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.m-login-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.m-login-card {
  background: var(--m-surface);
  border-radius: var(--m-radius-xl);
  padding: 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: var(--m-shadow-lg);
  text-align: center;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.m-login-overlay.active .m-login-card {
  transform: translateY(0) scale(1);
}

.m-login-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--m-radius-lg);
  background: var(--m-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 22px;
  margin: 0 auto 20px;
}

.m-login-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--m-text);
  margin: 0 0 4px;
}

.m-login-subtitle {
  font-size: 14px;
  color: var(--m-text-secondary);
  margin: 0 0 28px;
}

.m-login-field {
  text-align: left;
  margin-bottom: 16px;
}

.m-login-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--m-text-secondary);
  margin-bottom: 6px;
}

.m-login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--m-text);
  background: var(--m-bg);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--m-transition), box-shadow var(--m-transition);
}
.m-login-input:focus {
  border-color: var(--m-primary);
  box-shadow: 0 0 0 3px var(--m-primary-light);
}

.m-login-btn {
  width: 100%;
  padding: 12px 24px;
  background: var(--m-primary);
  color: var(--m-primary-text);
  border: none;
  border-radius: var(--m-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--m-transition), box-shadow var(--m-transition);
  margin-top: 8px;
}
.m-login-btn:hover {
  background: var(--m-primary-hover);
  box-shadow: var(--m-shadow-sm);
}

.m-login-error {
  color: var(--m-error);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}
.m-login-error.visible {
  display: block;
}

.m-login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--m-radius-full);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--m-text-tertiary);
  transition: background var(--m-transition);
}
.m-login-close:hover {
  background: var(--m-surface-hover);
}
.m-login-close svg {
  width: 18px;
  height: 18px;
}

/* ===== 27. SEARCH RESULTS HEADER ===== */
.m-search-results-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--m-primary-light);
  border: 1px solid var(--m-primary);
  border-radius: var(--m-radius-lg);
  margin-bottom: 20px;
}

.m-search-results-banner svg {
  width: 24px;
  height: 24px;
  color: var(--m-primary);
  flex-shrink: 0;
}

.m-search-results-text {
  flex: 1;
  font-size: 14px;
  color: var(--m-text);
}
.m-search-results-text strong {
  color: var(--m-primary);
}

.m-search-clear-btn {
  padding: 6px 16px;
  border-radius: var(--m-radius-full);
  border: 1px solid var(--m-primary);
  background: var(--m-surface);
  color: var(--m-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--m-transition);
  white-space: nowrap;
}
.m-search-clear-btn:hover {
  background: var(--m-primary);
  color: white;
}

/* ===== 28. GRID / CARD VIEW ===== */
.m-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.m-file-card {
  background: var(--m-bg);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
}

.m-file-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--m-shadow-md);
  border-color: var(--m-primary-light);
}

.m-file-card:focus, .m-file-row:focus {
  outline: 2px solid var(--m-primary);
  outline-offset: -2px;
}

.m-drag-over {
  outline: 2px dashed var(--m-primary) !important;
  outline-offset: -2px;
  background-color: var(--m-primary-light) !important;
}

.m-file-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--m-bg);
  overflow: hidden;
}

.m-file-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.m-file-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--m-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
}

.m-file-card-info {
  padding: 12px 14px;
}

.m-file-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--m-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.m-file-card-meta {
  font-size: 11px;
  color: var(--m-text-tertiary);
  display: flex;
  justify-content: space-between;
}

/* View Toggle Button */
.m-view-toggle {
  display: flex;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  overflow: hidden;
}

.m-view-toggle-btn {
  padding: 6px 10px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--m-text-tertiary);
  transition: all var(--m-transition);
}
.m-view-toggle-btn:first-child {
  border-right: 1px solid var(--m-border);
}
.m-view-toggle-btn.active {
  background: var(--m-primary-light);
  color: var(--m-primary);
}
.m-view-toggle-btn:hover:not(.active) {
  background: var(--m-surface-hover);
}
.m-view-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Remove old header inner overflow that clipped batch bar */
.m-filelist-header-inner {
  position: relative;
}

/* ===== 21. APPLE-LIKE AUDIO DOCK ===== */
.m-audio-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: rgba(var(--m-surface-rgb, 30, 30, 30), 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-xl);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--m-shadow-lg);
  z-index: 1200;
  min-width: 400px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modern-dark .m-audio-dock {
  background: rgba(15, 15, 15, 0.7);
}

.m-audio-dock.active {
  transform: translateX(-50%) translateY(0);
}

.m-audio-info {
  display: flex;
  flex-direction: column;
  min-width: 150px;
  max-width: 200px;
}

.m-audio-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--m-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-audio-artist {
  font-size: 11px;
  color: var(--m-text-secondary);
}

.m-audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.m-audio-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--m-radius-full);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--m-text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.m-audio-btn:hover {
  background: var(--m-surface-hover);
}

.m-audio-btn:active {
  transform: scale(0.9);
}

.m-audio-btn.play-pause {
  background: var(--m-primary);
  color: var(--m-primary-text);
}

.m-audio-btn.play-pause:hover {
  background: var(--m-primary-hover);
}

.m-audio-progress-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.m-audio-time {
  font-size: 11px;
  font-family: monospace;
  color: var(--m-text-tertiary);
  width: 40px;
  text-align: center;
}

.m-audio-scrubber {
  flex: 1;
  height: 6px;
  background: var(--m-border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.m-audio-scrub-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--m-primary);
  width: 0%;
  pointer-events: none;
}

.m-audio-close {
  background: none;
  border: none;
  color: var(--m-text-tertiary);
  cursor: pointer;
  margin-left: 10px;
}
.m-audio-close:hover {
  color: var(--m-error);
}

/* ===== 22. TOOLTIPS ===== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--m-text);
  color: var(--m-bg);
  padding: 6px 10px;
  border-radius: var(--m-radius);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2000;
  box-shadow: var(--m-shadow-md);
  font-weight: 500;
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* ===== 23. CONFIG BUILDER ===== */
.m-config-modal .m-modal {
  min-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.m-cb-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.m-cb-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-cb-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--m-primary);
  margin-bottom: 4px;
}

.m-cb-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-cb-form-group label {
  font-size: 12px;
  color: var(--m-text-secondary);
}
.m-cb-form-group input {
  padding: 8px 12px;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  background: var(--m-bg);
  color: var(--m-text);
  font-family: inherit;
  font-size: 13px;
}
input[type="checkbox"] {
  accent-color: var(--m-primary);
}
.m-cb-output {
  background: var(--m-bg);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #1a73e8;
  height: 100%;
  min-height: 200px;
  resize: none;
  white-space: pre-wrap;
}
.modern-dark .m-cb-output {
  color: #8ab4f8;
}

/* ===== 24. UNDO TOAST ===== */
.m-undo-toast {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--m-text);
  color: var(--m-bg);
  padding: 12px 20px;
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: bottom 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  z-index: 9000;
}

.m-undo-toast.active {
  bottom: 24px;
}

.m-undo-msg {
  font-size: 14px;
  font-weight: 500;
}

.m-undo-btn {
  background: transparent;
  border: none;
  color: #8ab4f8;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 13px;
}

.m-undo-btn:hover {
  background: rgba(138, 180, 248, 0.1);
}
