html {
  overflow-x: hidden;
  --sidebar-width: 350px;
  --folder-rail-width: 0px;
  --folder-tree-width: 280px;
  --icon-bx-folder: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M20%204h-8.59L10%202.59C9.63%202.22%209.11%202%208.59%202H4c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V6c0-1.1-.9-2-2-2%22%2F%3E%3C%2Fsvg%3E");
  --icon-bx-file: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M14.71%202.29A1%201%200%200%200%2014%202H6c-1.1%200-2%20.9-2%202v16c0%201.1.9%202%202%202h12c1.1%200%202-.9%202-2V8c0-.27-.11-.52-.29-.71zM13%209V3.5L18.5%209z%22%2F%3E%3C%2Fsvg%3E");
  --icon-bx-zip: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M7%206h2v2H7zm0%204v6h4V8H9v2zm3%203v2H8v-2z%22%2F%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22m19.94%207.68l-.03-.09a.8.8%200%200%200-.2-.29l-5-5c-.09-.09-.19-.15-.29-.2l-.09-.03a.8.8%200%200%200-.26-.05c-.02%200-.04-.01-.06-.01H6c-1.1%200-2%20.9-2%202v16c0%201.1.9%202%202%202h12c1.1%200%202-.9%202-2v-12s-.01-.04-.01-.06c0-.09-.02-.17-.05-.26ZM6%2020V4h3v2h2V4h2v4c0%20.55.45%201%201%201h4v11z%22%2F%3E%3C%2Fsvg%3E");
}

body {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg, #16161e);
  color: var(--text, #ffffff);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  padding-left: 0 !important;
  margin-left: 0 !important;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* AGGRESSIVE FIX: Global select styling - solid colors to prevent white on white */
select {
  color: #ffffff !important;
  background-color: #1e1e2e !important;
}

/* AGGRESSIVE FIX: All options MUST have dark background - override everything */
select option {
  background-color: #1e1e2e !important;
  background: #1e1e2e !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* AGGRESSIVE FIX: Default state - dark background */
select option:not(:checked):not([selected]):not(:hover) {
  background-color: #1e1e2e !important;
  background: #1e1e2e !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Hover MUST be dark blue - highest priority - comes before checked */
select option:hover {
  background-color: #0066cc !important;
  background: #0066cc !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Unselected hover - MUST be visible */
select option:hover:not(:checked):not([selected]) {
  background-color: #0066cc !important;
  background: #0066cc !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Selected state */
select option:checked,
select option[selected] {
  background: var(--primary-gradient, linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%)) !important;
  background-color: #0066cc !important;
  color: #ffffff !important;
}

/* AGGRESSIVE FIX: Selected + hover - MUST override hover rule */
select option:checked:hover,
select option[selected]:hover {
  background: var(--primary-gradient-hover, linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%)) !important;
  background-color: #0088ff !important;
  color: #ffffff !important;
}

/* Additional rules to override any browser defaults that might cause white backgrounds */
select option[value=""],
select option:empty {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

/* SIMPLIFIED: All specific selects inherit from global rules above - no need for duplicates */

/* Force dark background for all option states */
select option:not(:checked):not([selected]):not(:hover) {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

.container {
  display: flex;
  flex: 1;
  padding: 20px;
}

.sidebar {
  width: var(--sidebar-width, 350px);
  height: 100vh;
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0 !important;
  margin-left: 0 !important;
  transform: none !important;
  background: var(--surface, #1e1e2e);
  border-right: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  /* Flex + overflow-y ignores padding-bottom in Chromium; spacer ::after supplies it. */
  padding-bottom: 0;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scroll-padding-bottom: 32px;
  z-index: 100;
}

.sidebar > * {
  flex-shrink: 0;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sidebar > #current-filter {
  flex-shrink: 0;
}

/* Real flex item so the last buttons can scroll fully into view. */
.sidebar::after {
  content: '';
  display: block;
  flex: 0 0 40px;
  width: 100%;
  pointer-events: none;
}

.sidebar-chrome {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.library-view-banner {
  display: none;
  width: 85%;
  box-sizing: border-box;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-accent, #00d4ff);
  margin-top: 8px;
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 14%, var(--surface, #1e1e2e));
  border: 1px solid color-mix(in srgb, var(--primary-accent, #00d4ff) 35%, transparent);
  padding: 8px 12px;
  border-radius: 8px;
}

.sidebar:not(.filters-expanded) .filter-stack {
  display: none;
}

body.folder-rail-open {
  --folder-rail-width: var(--folder-tree-width, 280px);
}

/* Docker/Server mode: same layout fix + menu bar offset */
body.server-mode {
  overflow-x: hidden;
  padding-left: 0 !important;
  margin-left: 0 !important;
}
html.server-mode {
  overflow-x: hidden;
}
body.server-mode .sidebar {
  left: 0 !important;
  top: 30px !important;
  height: calc(100vh - 30px) !important;
  transform: none !important;
  margin-left: 0 !important;
}
/* A browser session cannot launch a local slicer, so hide that control. */
body.server-mode #preview-send-to-slicer,
body.server-mode #preview-slicer-menu {
  display: none !important;
}

#logo {
  width: 65%;
  height: auto;
  margin-bottom: -35px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  width: 85%;
  padding: 0 20px;
}

.form-group label {
  margin-bottom: 8px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.filter-section .search-models-field .input-with-icon {
  width: 100%;
}

/* Spyglass stays on the trailing edge. Clear sits immediately to its left. */
.filter-section .search-models-field .input-with-icon #filter-search-button {
  right: 4px;
  z-index: 11;
}

.filter-section .search-models-field .input-with-icon #clear-filter-search-button {
  right: 44px;
  z-index: 10;
}

.filter-section .search-notes-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  user-select: none;
}

.form-group .search-notes-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  margin: 0;
  cursor: pointer;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  background-image: none !important;
  box-shadow: none;
  backdrop-filter: none;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 40px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

.scheduled-backup-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#backup-restore-dialog {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

#backup-restore-dialog .dialog-buttons {
  position: sticky;
  bottom: 0;
  background: var(--surface, #1e1e2e);
  padding-top: 12px;
}

#backup-restore-dialog .scheduled-backup-path-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#backup-restore-dialog .scheduled-backup-path-row input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  background-image: none;
  padding-right: 16px;
}

#backup-restore-dialog #scheduled-backup-browse {
  width: auto;
  flex-shrink: 0;
  margin: 0;
}

#backup-restore-dialog .scheduled-backup-options {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  width: 85%;
  padding: 0 20px;
  box-sizing: border-box;
  margin-bottom: 10px;
}

#backup-restore-dialog .scheduled-backup-options .form-group {
  width: auto;
  padding: 0;
  margin-bottom: 0;
}

#backup-restore-dialog .scheduled-backup-options .form-group:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

#backup-restore-dialog .scheduled-backup-options .form-group:last-child {
  flex: 0 0 auto;
}

#backup-restore-dialog #scheduled-backup-time,
#backup-restore-dialog #scheduled-backup-keep {
  width: 6.5rem;
  background-image: none;
  padding-right: 12px;
  color-scheme: dark;
}

/* Model name field - text input without dropdown arrow */
#model-name {
  background-image: none !important;
  padding-right: 16px !important;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Notes input container */
.notes-input-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.notes-input-container textarea {
  flex: 1;
  width: calc(100% - 48px);
  max-width: calc(100% - 48px);
  max-height: 150px;
  min-height: 80px;
  overflow-y: auto;
  resize: vertical;
  box-sizing: border-box;
  background-image: none !important;
  padding-right: 16px !important;
}

.notes-input-container .icon-button {
  flex-shrink: 0;
  margin-top: 0;
}

.form-group select {
  color: #fff !important;
}

/* SIMPLIFIED: .form-group select options inherit from global select option rules */

.input-with-icon {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 85%;
  position: relative;
  overflow: visible;
}

.input-with-icon input {
  padding: 12px 50px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

/* Text fields with icon buttons are not selects. The form-group chevron
   otherwise paints over the clear button at the right edge. */
.form-group .input-with-icon input:not([type="checkbox"]):not([type="radio"]) {
  background-image: none;
}

.input-with-icon:has(.icon-button:nth-of-type(2):not(.hidden)) input {
  padding-right: 90px;
}

.input-with-icon:has(.icon-button:nth-of-type(2).hidden) input,
.input-with-icon:not(:has(.icon-button:nth-of-type(2):not(.hidden))) input {
  padding-right: 50px;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

.input-with-icon .icon-button {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  opacity: 0.8;
  transition: all 0.3s ease;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  margin: 0;
}

.input-with-icon .icon-button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 150, 200, 0.5);
  transform: translateY(-50%) scale(1.05);
}

.input-with-icon .icon-button:first-of-type:not(:only-of-type) {
  right: 44px;
}

.input-with-icon .icon-button:only-of-type {
  right: 4px;
}

.input-with-icon .icon-button:nth-of-type(2) {
  right: 4px;
  z-index: 11;
}

/* When clear button is hidden, adjust search button position */
.input-with-icon:has(.icon-button:nth-of-type(2).hidden) .icon-button:first-of-type,
.input-with-icon:not(:has(.icon-button:nth-of-type(2):not(.hidden))) .icon-button:first-of-type {
  right: 4px !important;
}

.input-with-icon .icon-button.hidden {
  display: none !important;
}

.path-tree-field {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.path-tree-container {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.path-tree-container:focus-within {
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.path-tree-item {
  display: flex;
  align-items: center;
  padding: 0;
  user-select: none;
  white-space: nowrap;
}

.path-tree-indent {
  display: inline-block;
  width: 16px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
}

.path-tree-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 2px;
  flex-shrink: 0;
  vertical-align: middle;
  background-color: var(--primary-accent, #00d4ff);
  -webkit-mask: var(--tree-glyph) center / contain no-repeat;
  mask: var(--tree-glyph) center / contain no-repeat;
}

.path-tree-folder-icon {
  --tree-glyph: var(--icon-bx-folder);
}

.path-tree-file-icon {
  --tree-glyph: var(--icon-bx-file);
}

.path-tree-zip-icon {
  --tree-glyph: var(--icon-bx-zip);
}

.path-tree-folder {
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.15s;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 2px;
  flex: 1;
}

.path-tree-folder:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.path-tree-file {
  color: #fff;
  cursor: default;
  display: inline-flex;
  align-items: center;
  flex: 1;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  padding: 12px 24px;
  margin-bottom: 10px;
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.15s ease;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  text-align: center;
  line-height: 1.4;
}

button:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

.secondary-button {
  background: transparent;
  color: var(--text, #fff);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  box-shadow: none;
}

.secondary-button:hover {
  background: var(--surface-raised, #2a2a3c);
  color: var(--text, #fff);
  transform: none;
  box-shadow: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.model-details {
  margin-top: 20px;
  width: 100%;
  max-width: none;
  background: color-mix(in srgb, var(--model-background-color) 25%, transparent);
  padding: 16px 0 24px;
  border-bottom: 1px solid #444;
  border-top: 1px solid #444;
  box-sizing: border-box;
}

.bundle-details-subtitle {
  margin: 0 0 12px;
  color: var(--text-muted, #aaa);
  font-size: 0.92rem;
}

/* `.model-details div` adds 10px under every nested div — reset for bundle panel. */
.bundle-details div {
  margin-bottom: 0;
}

.bundle-details > .form-group,
.bundle-details > .bundle-details-stats {
  margin-bottom: 12px;
}

.bundle-details-path-row {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
}

.bundle-details-path-row input {
  flex: 1;
  min-width: 0;
}

.bundle-details-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-muted, #bbb);
}

.bundle-contents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #444;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.bundle-contents-list > li {
  margin: 0;
  padding: 0;
}

.bundle-contents-list-item {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-bottom: 1px solid #3a3a3a;
  color: var(--text-color, #eee);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: static;
  background: transparent;
  box-shadow: none;
}

.bundle-contents-list-item::before {
  display: none;
}

.bundle-contents-list-item:last-child {
  border-bottom: none;
}

.bundle-contents-list-item:hover {
  transform: none;
  box-shadow: none;
  background: color-mix(in srgb, var(--accent-color, #4a9eff) 12%, transparent);
}

.bundle-contents-list-item.is-active {
  background: color-mix(in srgb, var(--accent-color, #4a9eff) 22%, transparent);
}

.parent-model-group.bundle-details-active {
  outline: 2px solid color-mix(in srgb, var(--accent-color, #4a9eff) 65%, transparent);
  outline-offset: 2px;
}

/* ============================================
   MODEL DETAILS FIELDS — match filter/search rows
   Label on top; field flexes; 28px actions on the right.
   ============================================ */

.model-details .form-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 16px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.model-details .designer-input-container,
.model-details .tags-input-container,
.model-details .input-with-icon,
.model-details .notes-input-container,
.model-details .path-tree-field,
.model-details .bundle-details-path-row,
.model-details .print-lifecycle-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

.model-details .notes-input-container {
  align-items: flex-start;
}

.model-details .tags-container {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.model-details .designer-input-container select,
.model-details .tags-input-container select,
.model-details .input-with-icon input,
.model-details .notes-input-container textarea,
.model-details .print-lifecycle-controls select,
.model-details #model-source,
.model-details #model-print-status,
.model-details #model-designer,
.model-details #model-parent,
.model-details #model-license,
.model-details #tag-select,
.model-details #filament-select {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.model-details .path-tree-container {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

.model-details .designer-input-container .icon-button,
.model-details .tags-input-container .icon-button,
.model-details .input-with-icon .icon-button,
.model-details .notes-input-container .icon-button,
.model-details .path-tree-field .icon-button,
.model-details .bundle-details-path-row .icon-button,
.model-details .print-lifecycle-controls .icon-button,
.model-details .print-history-label-row .icon-button {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin: 0;
  position: static;
  top: auto;
  right: auto;
  transform: none;
}

.model-details .tags-list {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.model-details h3 {
  padding: 0 16px;
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

/* Nested divs used to pick up a blanket 10px margin and throw off field spacing. */
.model-details div {
  margin-bottom: 0;
}

.model-details > .form-group {
  margin-bottom: 15px;
}

.checkbox-container {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 15px;
  margin-left: 0;
}

.checkbox-container label {
  margin: 0;
  cursor: default;
  flex: 1;
  pointer-events: none;
}

.checkbox-container input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
}

/* Override form-group column layout for checkbox containers */
.form-group.checkbox-container {
  flex-direction: row !important;
}

.form-group.checkbox-container label {
  margin-bottom: 0;
}

/* STL Home: checkbox row – only checkbox + label in one row; native checkbox look, themed size */
.stl-home-path-metadata-checkbox-row {
  margin-bottom: 0.5rem;
}
#stl-home-dialog #stl-home-path-metadata-enabled,
#stl-home-dialog #stl-home-use-designer,
#stl-home-dialog #stl-home-use-parent-model {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
  accent-color: var(--primary-accent, #00d4ff);
  cursor: pointer;
  pointer-events: auto;
}
#stl-home-dialog .stl-home-path-metadata-checkbox-row label {
  cursor: pointer;
  pointer-events: auto;
}
/* Ensure main Enable row is always clickable (Docker/server mode) */
#stl-home-dialog #stl-home-path-metadata-group > .checkbox-container:first-of-type {
  pointer-events: auto;
}

#stl-home-dialog form {
  max-width: 100%;
  box-sizing: border-box;
}
#stl-home-dialog .form-group {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
#stl-home-dialog .form-group input:not([type="checkbox"]):not([type="radio"]),
#stl-home-dialog .form-group select,
#stl-home-dialog .form-group textarea {
  box-sizing: border-box;
  max-width: 100%;
}
#stl-home-dialog .stl-home-exclude-add-row {
  max-width: 100%;
  min-width: 0;
}
#stl-home-dialog .stl-home-exclude-list {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
  max-height: min(320px, 40vh);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
#stl-home-dialog .stl-home-exclude-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#stl-home-dialog .stl-home-exclude-item:last-child {
  border-bottom: none;
}
#stl-home-dialog .stl-home-exclude-path {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.9em;
}
#stl-home-dialog .stl-home-exclude-empty {
  padding: 8px 10px;
  opacity: 0.7;
  font-size: 0.9em;
}
#stl-home-dialog .stl-home-exclude-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
#stl-home-dialog .stl-home-exclude-add-row input {
  flex: 1;
  min-width: 12rem;
  width: auto;
}
#stl-home-dialog .stl-home-exclude-add-row button,
#stl-home-dialog .stl-home-exclude-remove {
  width: auto;
  margin-bottom: 0;
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
/* Phone Docker layout forces 44px on every dialog button, which made each
   exclude row tall enough that a short list showed only two folders. */
body.mobile-ui #stl-home-dialog .stl-home-exclude-remove,
body.mobile-ui #stl-home-dialog .stl-home-exclude-add-row button {
  min-height: 36px;
}

/* STL Home: Designer and Parent model in columns side by side */
.path-metadata-indices {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  flex-wrap: wrap;
}
.path-metadata-indices .path-metadata-col {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}
.path-metadata-indices .path-metadata-col input[type="number"] {
  width: 4rem;
}

/* STL Home: path metadata options block – consistent spacing under Enable checkbox */
#stl-home-dialog .stl-home-path-metadata-options {
  margin-top: 0.75rem;
  margin-left: 0;
  text-align: left;
}

/* STL Home: path direction row – label above select, same pattern as Folder level rows */
#stl-home-dialog .stl-home-path-direction-row {
  margin-bottom: 0.75rem;
  max-width: 14rem;
}
#stl-home-dialog .stl-home-path-direction-row label {
  display: block;
  margin-bottom: 6px;
  text-align: left;
}
#stl-home-dialog .stl-home-path-direction-row select {
  width: 100%;
  min-width: 0;
}

/* STL Home: path direction description paragraphs – align with direction row */
#stl-home-dialog .stl-home-path-metadata-options .stl-home-path-direction-desc {
  margin-top: 0;
}

/* STL Home: gray out options when "Enable" is unchecked */
.stl-home-path-metadata-options.grayed {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

/* Example path in STL Home dialog */
#stl-home-dialog .path-example {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
.stl-home-path-metadata-options.grayed .path-example {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
}

/* STL Home dialog: ensure Cancel/Save buttons are clickable in Docker/server (browser) mode */
#stl-home-dialog .dialog-buttons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* File Type Settings dialog: ensure Save/Cancel buttons are clickable in Docker/server mode */
#file-type-settings-dialog .dialog-buttons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Purge Models dialog: ensure Purge/Cancel buttons are clickable in Docker/server mode */
#purge-models-dialog .dialog-buttons {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Docker/Server mode: ensure ALL modal dialog buttons and fullscreen toggles are clickable */
.modal .dialog-buttons,
.modal .modal-fullscreen-toggle,
.modal .dialog-buttons button {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Additional file types grid in File Type Settings */
.scan-file-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  margin-bottom: 0;
  padding: 0;
}

.scan-file-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  user-select: none;
}

.scan-file-type-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary-accent, #00d4ff);
  /* Keep input outside the label so one click toggles once (no label re-activation). */
  pointer-events: auto;
}

.scan-file-type-option label {
  flex: 0 1 auto;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-type-thumb-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 0;
}

.file-type-thumb-mark {
  --icon-file-type-thumb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2M8.5 13.5 11 16.51 14.5 12 19 18H5z'/%3E%3C/svg%3E");
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  background-color: var(--primary-accent, #00d4ff);
  -webkit-mask: var(--icon-file-type-thumb) center / contain no-repeat;
  mask: var(--icon-file-type-thumb) center / contain no-repeat;
}

.file-type-thumb-legend .file-type-thumb-mark {
  margin-left: 0;
}

main {
  position: relative;
}

/* Grid view selector background - full width element */
.grid-view-selector-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: calc(15px + 40px + 15px); /* padding-top + button height + padding-bottom */
  padding: 15px 0;
  background: var(--surface, #1e1e2e);
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  z-index: 0;
  pointer-events: none;
  box-sizing: border-box;
}

/* Grid view selector */
.grid-view-selector {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  margin-left: calc(var(--sidebar-width, 350px) + 20px + var(--folder-rail-width, 0px));
  width: calc(100% - (var(--sidebar-width, 350px) + 40px + var(--folder-rail-width, 0px)));
  background: transparent;
  z-index: 1;
  box-sizing: border-box;
}

.view-button {
  width: auto;
  max-width: none;
  margin-bottom: 0;
  flex: 0 0 auto;
  align-self: center;
  padding: 10px 20px;
  background: var(--surface-raised, #2a2a3c);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
}

.view-button:hover {
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 16%, var(--surface-raised, #2a2a3c));
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 45%, transparent);
  transform: none;
  box-shadow: none;
}

.view-button.active {
  background: var(--primary-accent, #00d4ff);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  row-gap: 32px;
  padding: 20px 24px;
  margin-left: calc(var(--sidebar-width, 350px) + 20px + var(--folder-rail-width, 0px));
  width: calc(100% - (var(--sidebar-width, 350px) + 40px + var(--folder-rail-width, 0px)));
  max-width: calc(100vw - (var(--sidebar-width, 350px) + 40px + var(--folder-rail-width, 0px)));
  box-sizing: border-box;
  overflow: visible;
  animation: fadeIn 0.5s ease-out;
  /* Subtle hexagon pattern background matching theme - default cyan */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  background-position: 0 0;
  position: relative;
  /* Recycled virtual-grid rows must not move the scroll offset. */
  overflow-anchor: none;
}

/* Theme-aware hexagon pattern */
[data-theme="modern-purple"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(168,85,247,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(168,85,247,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="modern-green"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(74,222,128,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(74,222,128,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="modern-orange"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(251,146,60,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(251,146,60,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="modern-pink"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(244,114,182,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(244,114,182,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

[data-theme="dark-minimal"] .file-grid {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(156,163,175,0.03)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(156,163,175,0.03)' stroke-width='0.5'/%3E%3C/svg%3E");
}

/* List view styles - Windows File Explorer style - Optimized */
.file-item-list {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start;
  padding: 8px 16px !important;
  height: 56px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0 0 6px 0;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  position: relative;
  background: var(--surface, #1e1e2e);
  border: 1px solid transparent;
  border-radius: 10px;
}

.file-item-list:hover {
  background: var(--surface-raised, #2a2a3c);
  transform: none;
  box-shadow: none;
  border-color: var(--border, rgba(255, 255, 255, 0.1));
}

.file-item-list .thumbnail-container {
  flex-shrink: 0 !important;
  width: 60px !important;
  height: 48px !important;
  margin-right: 12px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  z-index: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--model-background-color, #070147);
  align-self: center !important;
}

.file-item-list .thumbnail-container img {
  max-width: 48px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0;
}

.file-item-list .print-status,
.parent-model-group-list .print-status {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.file-item-list .print-status:hover,
.parent-model-group-list .print-status:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.05);
}

.file-item-list .print-status.printed,
.parent-model-group-list .print-status.printed {
  background: rgba(46, 204, 113, 0.6);
}

.file-item-list .print-status.printed:hover,
.parent-model-group-list .print-status.printed:hover {
  background: rgba(46, 204, 113, 0.85);
}

.file-item-list .archive-status {
  position: static !important;
  display: inline-block;
  background: rgba(255, 152, 0, 0.6);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
}

.file-item-list .file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 0;
  width: auto;
}

.file-item-list [data-list-col],
.parent-model-group-list [data-list-col] {
  overflow: hidden;
  box-sizing: border-box;
}

.file-item-list .file-name,
.parent-model-group-list .file-name {
  display: flex;
  align-items: center;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  white-space: nowrap;
  margin: 0;
}

.file-item-list .file-name.zip-file {
  color: #4ade80 !important;
}

.file-item-list .file-size-column {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
}

.file-item-list .directory-info-column,
.file-item-list .designer-info-column {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.file-item-list .tags-info-column {
  display: flex;
  align-items: center;
  overflow: visible;
  flex-shrink: 1;
  min-width: 160px;
}

.file-item-list .directory-info-column svg,
.file-item-list .designer-info-column svg,
.file-item-list .print-status-column svg,
.file-item-list .archive-status-column svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.file-item-list .print-status-column,
.file-item-list .archive-status-column {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* List view scrolls sideways when the columns are wider than the pane. */
.file-grid.is-list-view {
  overflow-x: auto;
}

.file-grid.is-list-view .list-view-header {
  width: max-content;
  min-width: 100%;
  max-width: none;
}

/* List view header styles */
.list-view-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px !important;
  height: 44px !important;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: var(--surface, #1e1e2e);
  position: sticky;
  top: -10px !important;
  z-index: 10;
  margin-bottom: 6px;
  box-sizing: border-box;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.list-view-header-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.list-view-header [data-list-col] {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.list-view-header [data-list-col="size"],
.list-view-header [data-list-col="dateadded"],
.list-view-header [data-list-col="printed"],
.list-view-header [data-list-col="archive"] {
  justify-content: center;
}

.list-view-header [data-list-col] .sortable-header {
  width: auto !important;
  max-width: 100%;
  flex: 0 0 auto;
}

.list-view-header [data-list-col] .sortable-header,
.list-view-header [data-list-col] > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-view-header svg {
  opacity: 0.6;
}

/* Sortable header styles */
.list-view-header .sortable-header {
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 2px 4px;
  border-radius: 4px;
}

.list-view-header .sortable-header:hover {
  background-color: transparent;
  color: #fff;
}

.list-view-header .sortable-header.sort-active {
  color: #fff !important;
  background-color: transparent;
}

.list-view-header .sort-indicator {
  font-size: 14px;
  font-weight: bold;
  color: #4a9eff;
  line-height: 1;
  margin-left: 4px;
}

.list-view-header .sortable-header.sort-active .sort-indicator {
  color: #6bb3ff;
}

/* List view: column picker (toolbar, next to view mode buttons) + resize */
.grid-view-selector .list-view-columns-toolbar-btn {
  width: auto;
  max-width: max-content;
  margin-bottom: 0;
  flex: 0 0 auto;
  align-self: center;
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.grid-view-selector .list-view-columns-toolbar-btn:hover {
  color: #fff;
  background: rgba(74, 158, 255, 0.18);
  border-color: rgba(74, 158, 255, 0.4);
  transform: none;
  box-shadow: none;
}

/* Preview tile size S/M/L — global `button` uses width:90% and pill styling; reset like .view-button.
   Scoped under .grid-view-selector so cascade beats generic rules and layout stays one row on WebKit/macOS. */
.grid-view-selector:not(.preview-view-active) .preview-size-switcher {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.preview-size-switcher[hidden] {
  display: none !important;
}

.grid-view-selector .preview-size-switcher {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  align-self: center !important;
  justify-content: flex-start !important;
  box-sizing: border-box;
  width: max-content !important;
  max-width: 100%;
  min-height: 0;
  gap: 2px;
  margin: 0 !important;
  padding: 2px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.grid-view-selector .preview-size-switcher > button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: none !important;
  min-width: 28px !important;
  height: 26px !important;
  margin: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 6px !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  align-self: center !important;
  float: none !important;
  box-sizing: border-box;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  line-height: 1 !important;
  color: rgba(255, 255, 255, 0.75) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer;
  box-shadow: none !important;
}

.grid-view-selector .preview-size-switcher > button::before {
  content: none !important;
  display: none !important;
}

.grid-view-selector .preview-size-switcher > button:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  transform: none !important;
  box-shadow: none !important;
}

.grid-view-selector .preview-size-switcher > button.active {
  color: #0a0a0a !important;
  background: var(--primary-accent, #00d4ff) !important;
}

/* Global `button` sets display:flex and kills native [hidden]; restore hiding */
#list-view-columns-toolbar-btn[hidden] {
  display: none !important;
}

.list-view-col {
  box-sizing: border-box;
}

.list-view-header .list-view-col {
  cursor: grab;
}

.list-view-header .list-view-col.is-dragging {
  opacity: 0.4;
}

.list-view-header .list-view-col.list-view-col-drop-before::before,
.list-view-header .list-view-col.list-view-col-drop-after::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: #4a9eff;
  border-radius: 2px;
  z-index: 3;
  pointer-events: none;
}

.list-view-header .list-view-col.list-view-col-drop-before::before {
  left: -2px;
}

.list-view-header .list-view-col.list-view-col-drop-after::after {
  right: -2px;
}

body.list-view-col-reorder-active,
body.list-view-col-reorder-active * {
  cursor: grabbing !important;
  user-select: none !important;
}

.list-view-col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  margin-right: -3px;
  cursor: col-resize;
  z-index: 2;
}
.list-view-col-resize-handle:hover {
  background: rgba(74, 158, 255, 0.35);
}

.list-view-columns-popover {
  min-width: 220px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 10px 12px;
  background: rgba(22, 22, 34, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.list-view-columns-popover-hint {
  margin: 0 0 8px;
  padding: 0 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1.35;
  color: #9aa0b4;
}

.list-view-columns-popover-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  user-select: none;
}
.list-view-columns-popover-row input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #4a9eff;
}

/* Parent model grouping */
.parent-model-group {
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(91, 159, 255, 0.06));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.parent-model-group.file-item-detailed,
.parent-model-group.file-item-preview {
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.parent-model-group.file-item-detailed {
  flex-direction: column;
  width: 300px;
  height: 490px !important;
  padding: 12px 12px 0;
}

.parent-model-group.file-item-preview {
  flex-direction: column;
  width: 180px;
  height: 220px;
  padding: 12px;
}

.parent-model-group:hover,
.parent-model-group:focus-visible {
  border-color: rgba(0, 212, 255, 0.42);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(91, 159, 255, 0.1));
  outline: none;
}

.parent-model-group:hover {
  transform: translateY(-1px);
}

.parent-model-group.file-item-detailed:hover,
.parent-model-group.file-item-preview:hover,
.parent-model-group.file-item-detailed:focus-visible,
.parent-model-group.file-item-preview:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 150, 200, 0.5);
}

.parent-model-group-thumbnail {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  background: var(--model-background-color, #070147);
  border: 1px solid rgba(0, 212, 255, 0.22);
  position: relative;
}

.parent-model-group-detailed .parent-model-group-thumbnail {
  width: 276px;
  height: 276px;
  border-radius: 6px;
}

.parent-model-group-preview .parent-model-group-thumbnail {
  width: 140px;
  height: 140px;
  border-radius: 6px;
}

.parent-model-group-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.parent-model-group-corner-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 34px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(0, 212, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 12;
}

.parent-model-group-corner-badge span {
  position: absolute;
  display: block;
  width: 15px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.16);
  transition: all 0.2s ease;
}

/* Collapsed: cards tightly stacked */
.parent-model-group-corner-badge.is-collapsed span:nth-child(1) {
  left: 8px;
  top: 11px;
  opacity: 0.85;
  z-index: 1;
}

.parent-model-group-corner-badge.is-collapsed span:nth-child(2) {
  left: 11px;
  top: 8px;
  opacity: 0.92;
  z-index: 2;
}

.parent-model-group-corner-badge.is-collapsed span:nth-child(3) {
  left: 14px;
  top: 5px;
  opacity: 1;
  z-index: 3;
}

/* Expanded: cards spread/fanned out */
.parent-model-group-corner-badge.is-expanded span:nth-child(1) {
  left: 4px;
  top: 12px;
  opacity: 0.9;
  z-index: 1;
}

.parent-model-group-corner-badge.is-expanded span:nth-child(2) {
  left: 10px;
  top: 8px;
  opacity: 0.95;
  z-index: 2;
}

.parent-model-group-corner-badge.is-expanded span:nth-child(3) {
  left: 16px;
  top: 4px;
  opacity: 1;
  z-index: 3;
}

.parent-model-group-details {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.parent-model-group-detailed .parent-model-group-details,
.parent-model-group-preview .parent-model-group-details {
  width: 100%;
  text-align: center;
  align-items: center;
}

.parent-model-group-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.parent-model-group-detailed .parent-model-group-title-row,
.parent-model-group-preview .parent-model-group-title-row {
  justify-content: center;
  width: 100%;
}

.parent-model-group-chevron {
  flex: 0 0 auto;
  width: 18px;
  color: var(--primary-accent, #00d4ff);
  font-size: 16px;
  line-height: 1;
}

.parent-model-group-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}

.parent-model-filter-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(0, 212, 255, 0.5);
  text-underline-offset: 2px;
}

.parent-model-filter-link:hover {
  color: #7eb8ff;
  text-decoration-color: rgba(126, 184, 255, 0.8);
}

.parent-model-group-detailed .parent-model-group-title {
  max-width: 240px;
  font-size: 13px;
}

.parent-model-group-preview .parent-model-group-title {
  max-width: 120px;
  font-size: 11px;
  line-height: 1.3;
}

.parent-model-group-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parent-model-group-tags {
  color: #ccc;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parent-model-group-detailed .parent-model-group-tags {
  white-space: normal;
}

.parent-model-group-detailed .parent-model-group-meta,
.parent-model-group-preview .parent-model-group-meta {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
  padding: 0 4px;
  box-sizing: border-box;
}

.parent-model-group-preview .parent-model-group-meta {
  font-size: 11px;
}

.parent-model-group-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 8px 16px;
  border-radius: 12px;
  box-sizing: border-box;
}

.parent-model-group-list .parent-model-group-thumbnail {
  flex-shrink: 0;
  width: 60px;
  height: 48px;
}

.parent-model-group-list .file-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 0;
  width: auto;
}

.parent-model-group-list .file-name {
  display: flex;
  align-items: center;
  margin: 0;
}

.parent-model-group-list .parent-model-group-title-row {
  min-width: 0;
  flex: 1;
}

.parent-model-group-list .parent-model-group-title {
  font-size: 13px;
  font-weight: 600;
}

.parent-model-group-list .parent-model-group-corner-badge {
  top: 4px;
  left: 4px;
  transform: scale(0.72);
  transform-origin: top left;
}

.parent-model-group-list .parent-model-group-title {
  font-size: 14px;
}

.file-item.parent-model-group-child {
  position: relative;
  border: 2px solid rgba(0, 212, 255, 0.62);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.22), 0 10px 28px rgba(0, 0, 0, 0.3);
  background: linear-gradient(165deg, rgba(0, 212, 255, 0.12), rgba(0, 212, 255, 0.04));
}

/* Keep grouped highlight visible in detailed/preview cards even when other card styles render. */
.file-item.file-item-detailed.parent-model-group-child::before,
.file-item.file-item-preview.parent-model-group-child::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(0, 212, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.3);
  pointer-events: none;
  z-index: 2;
}

/* Row-level badge used top/right 8px and collided with .archive-status and list tags; show on thumbnail */
.file-item.parent-model-group-child::after {
  content: none;
}

/* Preview + detailed: bottom-left (clear of top-right archive + bottom ... menu strip) */
.file-item.parent-model-group-child .thumbnail-container::after {
  content: "GROUPED";
  position: absolute;
  top: auto;
  right: auto;
  bottom: 40px;
  left: 8px;
  z-index: 12;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.82);
  color: #03121a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  line-height: 1.2;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-list.parent-model-group-child {
  border-left: 4px solid var(--primary-accent, #00d4ff);
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.12) 0, rgba(0, 212, 255, 0.06) 56px, rgba(255, 255, 255, 0.02) 57px, rgba(255, 255, 255, 0.02) 100%);
  position: relative;
}

.file-item-list.parent-model-group-child::before {
  content: "";
  position: absolute;
  left: -4px;
  width: 4px;
  background: rgba(0, 212, 255, 0.8);
}

.file-item-list.parent-model-group-child-start::before {
  top: 0;
  bottom: 50%;
  border-top-left-radius: 8px;
}

.file-item-list.parent-model-group-child-middle::before {
  top: 0;
  bottom: 0;
}

.file-item-list.parent-model-group-child-end::before {
  top: 50%;
  bottom: 0;
  border-bottom-left-radius: 8px;
}

.file-item-list.parent-model-group-child-single::before {
  top: 0;
  bottom: 0;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* List: archive is in its own column; keep label compact top-right on the thumb */
.file-item-list.parent-model-group-child .thumbnail-container::after {
  top: 2px;
  left: auto;
  bottom: auto;
  right: 2px;
  padding: 2px 5px;
  font-size: 9px;
  max-width: calc(100% - 4px);
}

/* Preview view (formerly Small thumbnail) - Optimized */
.file-item-preview {
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.28));
}

.file-item-preview:hover {
  transform: none;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
  background: var(--surface-raised, #2a2a3c);
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 55%, transparent);
}

.file-item-preview .thumbnail-container {
  width: 140px !important;
  height: 140px !important;
  border-radius: 6px;
  overflow: hidden;
}

.file-item-preview .file-info {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.file-item-preview .file-name {
  font-size: 11px;
  line-height: 1.3;
  max-height: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}


/* Detailed view - large thumbnail with full metadata - Optimized */
.file-item-detailed {
  width: 300px;
  height: 490px !important;
  min-height: 490px !important;
  max-height: 490px !important;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 0;
  box-sizing: border-box;
  border-radius: 12px;
  overflow: hidden;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.28));
}

.file-item-detailed:hover {
  transform: none;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
  background: var(--surface-raised, #2a2a3c);
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 55%, transparent);
}

/* Keep grouped-card highlight persistent after base card and hover rules are applied. */
.file-item-preview.parent-model-group-child,
.file-item-detailed.parent-model-group-child {
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 12%, var(--surface, #1e1e2e)) !important;
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 72%, transparent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-accent, #00d4ff) 22%, transparent) !important;
}

.file-item-preview.parent-model-group-child:hover,
.file-item-detailed.parent-model-group-child:hover {
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 16%, var(--surface, #1e1e2e)) !important;
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 85%, transparent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-accent, #00d4ff) 28%, transparent) !important;
}

.file-item-detailed .thumbnail-container {
  width: 276px !important;
  height: 276px !important;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.file-item-detailed .file-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-top: 8px;
  margin-bottom: 6px;
  padding: 2px 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  box-sizing: border-box;
  min-height: 24px;
  line-height: 1.3;
  background: transparent;
  border-radius: 0;
  flex-shrink: 0;
}

.file-item-detailed .file-info {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  overflow: visible;
  padding: 0 !important; /* Override all padding from other rules */
  margin: 0;
}

.file-item-detailed .file-details {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
}

.model-engagement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  margin-left: -16px;
  margin-right: -16px;
  margin-bottom: 0;
  width: calc(100% + 32px);
  flex: 0 0 auto;
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 14px 16px;
  box-sizing: border-box;
  border-top: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.18) 35%,
    rgba(0, 0, 0, 0.32) 100%
  );
  border-radius: 0 0 16px 16px;
  overflow: visible;
}

.model-engagement-bar.is-group {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.14) 35%,
    rgba(0, 0, 0, 0.26) 100%
  );
}

/* Reset global button styles (width: 90%, pill gradient, etc.) */
.model-engagement-bar button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-weight: normal;
  line-height: 1;
  text-align: center;
  position: static;
  overflow: visible;
}

.model-engagement-bar button::before {
  display: none;
}

.model-rating {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
}

.model-star {
  font-size: 17px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s ease, transform 0.15s ease;
}

/* Beat `.model-engagement-bar button { line-height: 1 }` from the reset above */
.model-engagement-bar .model-star {
  line-height: 1.25;
  padding: 2px 1px;
}

.model-star.is-filled,
.model-star:hover {
  color: #00d4ff;
  transform: scale(1.06);
}

.model-favorite-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.model-favorite-btn:hover {
  color: #ff6b8a;
  background: rgba(255, 107, 138, 0.14);
  transform: scale(1.08);
}

.model-favorite-btn.is-favorited {
  color: #ff4d6d;
  background: rgba(255, 77, 109, 0.16);
}

.parent-model-group.file-item-detailed {
  display: flex;
  flex-direction: column;
}

.parent-model-group.file-item-detailed .model-engagement-bar {
  margin-left: -12px;
  margin-right: -12px;
  margin-bottom: 0;
  width: calc(100% + 24px);
  border-radius: 0 0 16px 16px;
  padding-bottom: 14px;
}

.file-item-detailed:not(.parent-model-group) .model-engagement-bar {
  margin-left: -16px;
  margin-right: -16px;
  margin-bottom: 0;
  width: calc(100% + 32px);
  padding-bottom: 16px;
}

/* Keep engagement bar visible; metadata can use natural height now that cards are taller */
.file-item-detailed .file-info {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: visible;
}

.file-item-detailed .file-details {
  margin: 0;
  padding: 0;
  border-top: none;
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
}

.file-item-detailed .metadata-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding: 0;
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: none;
  overflow: hidden;
  box-sizing: border-box;
}

.file-item-detailed .metadata-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 0;
  transition: all 0.2s ease;
  min-height: 18px; /* Slightly increased for better readability */
  line-height: 1.3;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0;
}

.file-item-detailed .metadata-item.tags-item {
  padding-bottom: 8px;
}

.file-item-detailed .metadata-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  word-break: keep-all;
  max-width: 100%;
}

.file-item-detailed .metadata-value.file-size {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.file-item-detailed .metadata-item.directory-item {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0;
}

.file-item-detailed .metadata-item.directory-item:hover {
  background: rgba(74, 158, 255, 0.1);
}

.file-item-detailed .metadata-icon {
  font-size: 12px;
  opacity: 0.8;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.file-item-detailed .metadata-item.designer-item .metadata-icon {
  filter: hue-rotate(240deg) saturate(1.5) brightness(1.2);
}

.file-item-detailed .metadata-value {
  color: #ccc;
  font-weight: 400;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

.file-item-detailed .metadata-value.file-size {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
  max-width: none;
}

.file-item-detailed .metadata-value.directory-link {
  color: #4a9eff;
  font-weight: 500;
  cursor: pointer;
}

/* Fix for dir-size-row: ensure directory can truncate and size is always visible */
.file-item-detailed .metadata-item.dir-size-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0;
  width: 100%;
}

.file-item-detailed .metadata-item.dir-size-row .directory-part {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100% - 80px); /* Reserve space for size */
}

.file-item-detailed .metadata-item.dir-size-row .directory-part .metadata-value.directory-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.file-item-detailed .metadata-item.dir-size-row .size-part,
.file-item-detailed .metadata-item.dir-size-row .metadata-value.file-size {
  flex-shrink: 0 !important;
  min-width: fit-content !important;
  margin-left: auto;
  white-space: nowrap;
}

/* Same fix for grid view */
.file-grid .metadata-item.dir-size-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0;
  width: 100%;
}

.file-grid .metadata-item.dir-size-row .directory-part {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100% - 80px); /* Reserve space for size */
}

.file-grid .metadata-item.dir-size-row .directory-part .metadata-value.directory-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.file-grid .metadata-item.dir-size-row .size-part,
.file-grid .metadata-item.dir-size-row .metadata-value.file-size {
  flex-shrink: 0 !important;
  min-width: fit-content !important;
  margin-left: auto;
  white-space: nowrap;
}

.file-item-detailed .metadata-item.directory-item:hover .metadata-value.directory-link {
  color: #6bb3ff;
}

.file-item-detailed .metadata-item.clickable-metadata {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0;
  transition: background 0.2s ease;
}

.file-item-detailed .metadata-item.clickable-metadata:hover {
  background: rgba(74, 158, 255, 0.1);
}

.file-item-detailed .metadata-item.clickable-metadata:hover .metadata-value {
  color: #4a9eff;
}

/* Clickable tag names in model grid (list + detailed) — filter by tag */
.tag-filter-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}
.tag-filter-link:hover {
  color: #7eb8ff;
  text-decoration-color: rgba(126, 184, 255, 0.8);
}

.file-item {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--surface, #1e1e2e);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.file-item.selected {
  border: 2px solid var(--primary-accent, #00d4ff);
  box-shadow: none;
  position: relative;
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 12%, var(--surface, #1e1e2e));
}

.file-item.selected::before {
  display: none; /* Selection check bubble removed; selection still shown via border/outline */
}

.file-item.selected .model-preview {
  border-color: var(--primary-accent, #00d4ff);
}

.model-container {
  width: 100%;
  aspect-ratio: 1; /* This maintains square proportions */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  overflow: hidden;
  background-color: #0a0a23; /* Update this line with the new color */
}

.model-container img {
  border-radius: 10px;
}

header {
  text-align: center;
  margin-bottom: 20px;
}

#save-model-button {
  background-color: #007bff; /* Blue button */
  color: white;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  margin-top: 10px; /* Space above the button */
  width: 100%; /* Button width */
  text-align: center;
}

#save-model-button:hover {
  background-color: #0056b3; /* Darker blue on hover */
}

#refresh-thumbnail-button {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  text-align: center;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

#refresh-thumbnail-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, #5ae890 0%, #2dd66f 100%);
}

.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.loader {
  border: 16px solid rgba(255, 255, 255, 0.1);
  border-top: 16px solid #00d4ff;
  border-right: 16px solid #5b9fff;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 30px rgba(0, 150, 200, 0.5);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.hidden {
  display: none;
}

#spinner {
  background-color: #000000; /* Set the spinner background color to black */
  color: #ffffff; /* Set spinner text color to white */
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.5) 0%, rgba(91, 159, 255, 0.5) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.7) 0%, rgba(91, 159, 255, 0.7) 100%);
  background-clip: padding-box;
}

.designer-input-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

/* Ensure buttons align vertically with dropdowns */
.designer-input-container .list-button,
.designer-input-container .icon-button {
  vertical-align: middle;
}

/* Base styles for designer-input-container selects (not in model-details) */
.designer-input-container select {
  flex: 1;
  margin-right: 0;
  min-width: 0;
}

.designer-input-container .icon-button {
  flex-shrink: 0;
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color 0.15s ease;
  box-shadow: none;
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
}

.designer-input-container .icon-button:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

/* Base styles for model detail dropdowns - will be overridden by .model-details rules */
#model-designer {
  flex: 1;
  padding: 12px 16px;
  padding-right: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

#model-designer:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

/* SIMPLIFIED: #model-designer options inherit from global select option rules */
#model-designer {
  color: #fff !important;
}


.model-details .input-with-icon .icon-button {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  opacity: 1;
  background: var(--primary-accent, #00d4ff);
  border: none;
  box-shadow: none;
}

.model-details .input-with-icon .icon-button:hover {
  transform: none;
  background: var(--primary-accent-hover, #5b9fff);
}

.model-details .input-with-icon input {
  padding-right: 16px;
}

.designer-input-container select:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* SIMPLIFIED: .designer-input-container select options inherit from global select option rules */
.designer-input-container select {
  color: #fff !important;
}

/* Dropdown with List button container */
.dropdown-with-list {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* Ensure list button aligns vertically with dropdown */
.dropdown-with-list .list-button {
  vertical-align: middle;
}

.dropdown-with-list select {
  flex: 1;
  min-width: 0;
}

/* Filter dropdown + list-button row must stay inside the sidebar (do not use 100% + button). */
.sidebar .dropdown-with-list {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sidebar .dropdown-with-list select,
.sidebar .dropdown-with-list .tags-input-container {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
}

.sidebar .dropdown-with-list .tags-input-container select,
.sidebar .dropdown-with-list .tags-input-container input#tag-filter {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.sidebar .dropdown-with-list .list-button,
.sidebar .dropdown-with-list .folder-tree-button {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin: 0;
}

/* Filter dropdowns without a list button align with the select column beside those buttons. */
.filter-section .form-group:not(:has(.dropdown-with-list)) select {
  width: calc(100% - 34px);
  max-width: none;
  margin-right: 34px;
  box-sizing: border-box;
}

/* List button styling - matches icon-button style, smaller size */
.list-button {
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  margin-right: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: background-color 0.15s ease;
  box-shadow: none;
  flex-shrink: 0;
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
}

.list-button:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

.list-button:active {
  transform: none;
}

/* Searchable list dialog styles */
.searchable-list-container {
  max-height: 400px;
  overflow-y: auto;
  margin: 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.searchable-list {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.searchable-list li {
  padding: 12px 16px;
  margin: 4px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}

.searchable-list li:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateX(4px);
}

.searchable-list li.selected {
  background: var(--primary-accent, #00d4ff);
  border-color: rgba(0, 212, 255, 0.5);
  color: white;
  font-weight: 500;
}

.searchable-list li:empty {
  display: none;
}

#searchable-list-dialog {
  min-width: 400px;
  max-width: 600px;
}

#searchable-list-search {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  margin-bottom: 16px;
}

#searchable-list-search:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

#add-new-designer-button,
#add-new-parent-button,
#add-new-license-button,
#bulk-add-designer-button,
#bulk-add-parent-button,
#add-tag-button {
  padding: 0;
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  box-shadow: none;
  flex-shrink: 0;
  align-self: center;
}

#add-new-designer-button:hover,
#add-new-parent-button:hover,
#add-new-license-button:hover,
#bulk-add-designer-button:hover,
#bulk-add-parent-button:hover,
#add-tag-button:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

/* Closed dialogs must never eat clicks if CSS keeps them in the layout. */
dialog:not([open]) {
  pointer-events: none !important;
}

.modal {
  border: none;
  border-radius: 16px;
  padding: 32px;
  background: var(--surface, #1e1e2e);
  color: white;
  max-width: 1000px;
  width: 80%;
  box-sizing: border-box;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

/* Keyboard shortcuts dialog */
.keyboard-shortcuts-intro {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  opacity: 0.9;
}
.keyboard-shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.keyboard-shortcuts-list .shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.keyboard-shortcuts-list .shortcut-action {
  flex: 1;
}
.keyboard-shortcuts-list kbd {
  display: inline-block;
  padding: 0.2em 0.5em;
  font-size: 0.85em;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  white-space: nowrap;
}

.dialog-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.dialog-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.dialog-buttons button[type="submit"] {
  background: var(--primary-accent, #00d4ff);
  color: white;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  transition: background-color 0.15s ease;
  box-shadow: none;
}

.dialog-buttons button[type="submit"]:hover {
  transform: none;
  background: var(--primary-accent-hover, #5b9fff);
  box-shadow: none;
}

/* STL Home Save button is type="button" for Docker/server save reliability; keep primary style */
#stl-home-dialog #save-stl-home-button {
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  box-shadow: none;
}
#stl-home-dialog #save-stl-home-button:hover {
  transform: none;
  background: var(--primary-accent-hover, #5b9fff);
  box-shadow: none;
}

.dialog-buttons button[type="button"] {
  background: transparent;
  color: white;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.dialog-buttons button[type="button"]:hover {
  background: var(--surface-raised, #2a2a3c);
  transform: none;
}

/* Center cancel button in searchable list dialog */
#searchable-list-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Center close button in backup-restore dialog */
#backup-restore-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Center close button in stats dialog */
#stats-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#stats-dialog .dialog-buttons button {
  width: auto;
  flex: 0 0 auto;
}

/* Center close button in manage thumbnails dialog */
#manage-thumbnails-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

#manage-thumbnails-dialog .dialog-buttons button {
  width: auto;
  flex: 0 0 auto;
}

#new-designer-name {
  width: 100%;
  padding: 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

#clear-parent-button {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  min-width: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#clear-parent-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Base styles for model detail dropdowns - will be overridden by .model-details rules */
#model-parent,
#model-license {
  flex: 1;
  padding: 12px 16px;
  padding-right: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

#model-parent:focus,
#model-license:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

/* SIMPLIFIED: #model-parent and #model-license options inherit from global select option rules */
#model-parent,
#model-license {
  color: #fff !important;
}

.search-container {
  position: relative;
  margin-bottom: 10px;
  padding: 0 20px;
}

#search-input {
  width: 85%;
  padding: 8px 30px 8px 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

#search-input::placeholder {
  color: #999;
}

#clear-search-button {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 18px;
  padding: 0 8px;
  display: none;
}

#clear-search-button:hover {
  color: #fff;
}

/* Show clear button when search has input */
#search-input:not(:placeholder-shown) + #clear-search-button {
  display: block;
}

/* Update the styles for the tag select */
/* #model-tags is now a div container with class tags-list, not a select element */
/* Removed select-specific styles - using .tags-list styles instead */

/* Remove the old tag styles */
.tags-container,
.tags-input-container,
.tags-list,
.tag,
.tag-remove {
  display: none;
}

.tags-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tags-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* Ensure buttons in tags-input-container are perfectly aligned with dropdown */
.tags-input-container .list-button,
.tags-input-container .icon-button,
.tags-input-container .add-tag-button {
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
  vertical-align: middle;
  line-height: 1;
}

.tags-input-container select {
  flex: 1;
  padding: 12px 16px;
  padding-right: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: all 0.3s ease;
}

.tags-input-container input#tag-filter {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  min-width: 0;
  box-sizing: border-box;
  font: inherit;
  transition: all 0.3s ease;
}

/* In edit view, tag filter has 2 buttons (list, add) - allow full width */
.tags-input-container:has(.list-button) select {
  flex: 1;
  min-width: 0;
}

/* In filter view, tag filter only has list button - field fills the flex slot beside it */
.dropdown-with-list:has(#tag-filter) .tags-input-container input#tag-filter {
  max-width: none;
}

.tags-input-container select:focus,
.tags-input-container input#tag-filter:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* SIMPLIFIED: .tags-input-container select options inherit from global select option rules */
.tags-input-container select,
.tags-input-container input#tag-filter {
  color: #fff !important;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 4px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  width: 85%;
  overflow-x: hidden;
  overflow-y: visible;
  align-content: flex-start;
}

.tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: #007bff;
  color: white;
  border-radius: 16px;
  font-size: 14px;
  max-width: 100%;
  overflow: hidden;
}

.tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tag-remove {
  display: inline-flex;  /* Change from display: none */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s;
}

.tag-remove:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Filter section styling */
.filter-section {
  display: flex;
  flex-direction: column;
  width: calc(100% - 16px);
  max-width: 100%;
  min-width: 0;
  padding: 16px 0 28px;
  margin: 8px 8px 0;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  flex: 0 0 auto;
  overflow: visible;
  box-sizing: border-box;
}

.filter-pinned {
  flex-shrink: 0;
}

.filter-stack {
  flex: 0 0 auto;
  overflow: visible;
  padding-bottom: 16px;
  box-sizing: border-box;
}

.filter-stack-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  max-width: none;
  margin: 4px 16px 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: none;
  flex-shrink: 0;
  overflow: visible;
}

.filter-stack-toggle::before {
  display: none;
}

.filter-stack-toggle:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.filter-stack-toggle-chevron {
  opacity: 0.7;
}

.filter-section .form-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-bottom: 15px;
  padding: 0 16px;
  box-sizing: border-box;
}

.filter-section select {
  width: 85%; 
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 16px;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: all 0.3s ease;
}

.filter-section select:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px var(--primary-shadow, rgba(0, 212, 255, 0.2));
}

.filter-section select {
  color: #fff !important;
}

/* SIMPLIFIED: .filter-section select options inherit from global select option rules */

.filter-section select option[value=""],
.filter-section select option:empty {
  background: rgba(30, 30, 46, 0.95) !important;
  background-color: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

.filter-section label {
  text-align: left;
  width: 100%;
  margin-bottom: 5px;
}

.progress-container {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: visible;
  position: relative;
}

.progress-container progress {
  width: 100%;
  height: 24px;
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  position: relative;
  flex-shrink: 0;
}

.progress-container .progress-text {
  margin-top: 4px;
  margin-bottom: 0;
  padding: 0;
  min-height: 18px;
  line-height: 1.4;
}

.progress-container progress::-webkit-progress-bar {
  background-color: rgba(20, 20, 20, 0.9);
  border-radius: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.stop-button {
  position: relative;
  width: 85%;
  margin: 10px auto;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff3b30 100%);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.stop-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 59, 48, 0.4);
  background: linear-gradient(135deg, #ff7b7b 0%, #ff4b40 100%);
}

.progress-bar {
  height: 100%;
  background-color: #4CAF50;
  width: 0%;
  transition: width 0.3s;
}

#progress-status {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}

.progress-container + .progress-container {
  margin-top: 10px;
}

#render-progress-container .progress-bar {
  background-color: #28a745; /* Different color for render progress */
}

.bulk-edit-button {
  display: none;
}

.selected-count {
  color: #999;
  margin-bottom: 20px;
  font-size: 14px;
}

#multi-edit-panel .selected-count {
  padding: 0 16px;
}

#multi-save-button {
  background-color: #28a745;
  margin-top: 20px;
}

#multi-save-button:hover {
  background-color: #218838;
}

/* Make multi-edit panel match model details styling */
#multi-edit-panel.model-details {
  margin-top: 20px;
  width: 100%;
  background: color-mix(in srgb, var(--model-background-color) 25%, transparent);
  padding: 16px 0 24px;
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
}

#multi-edit-panel h3 {
  padding: 0 16px;
  margin-top: 0;
  margin-bottom: 15px;
}

#multi-edit-panel .form-group {
  margin-bottom: 15px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 16px;
  box-sizing: border-box;
}

#multi-edit-panel .full-width-button {
  width: calc(100% - 32px);
  max-width: none;
  margin: 8px 16px;
}

#multi-edit-panel .checkbox-container {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 8px 16px;
  margin-bottom: 15px;
  margin-left: 0;
}

#multi-edit-panel .checkbox-container label {
  margin: 0;
  flex: 1;
  cursor: pointer;
}

#multi-edit-panel .checkbox-container input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--primary-accent, #00d4ff);
  flex-shrink: 0;
}

#edit-mode-toggle {
  background: var(--primary-accent, #00d4ff);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  width: calc(100% - 40px);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.3);
}

#edit-mode-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 159, 255, 0.4);
}

#edit-mode-toggle.active {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

#edit-mode-toggle.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

#invert-filter-button {
  width: calc(100% - 40px);
  max-width: 280px;
  padding: 8px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Disable global before shimmer on this button so it stays centered/aligned */
#invert-filter-button::before {
  content: none !important;
  display: none !important;
}



#invert-filter-button.active {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

#invert-filter-button.active:hover {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* Apply the same styles to multi-edit panel */
#multi-edit-panel .designer-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

#multi-edit-panel .designer-input-container select {
  flex: 1;
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

#multi-edit-panel .designer-input-container select option {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:not(:checked):not([selected]):not(:hover) {
  background-color: rgba(30, 30, 46, 0.95) !important;
  background: rgba(30, 30, 46, 0.95) !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:checked,
#multi-edit-panel .designer-input-container select option[selected] {
  background: var(--primary-gradient, linear-gradient(135deg, #00d4ff 0%, #5b9fff 100%)) !important;
  background-color: transparent !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:checked:hover,
#multi-edit-panel .designer-input-container select option[selected]:hover {
  background: var(--primary-gradient-hover, linear-gradient(135deg, #00e5ff 0%, #6ba8ff 100%)) !important;
  background-color: transparent !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container select option:hover:not(:checked):not([selected]) {
  background-color: rgba(0, 150, 200, 0.5) !important;
  background: rgba(0, 150, 200, 0.5) !important;
  color: #fff !important;
}

#multi-edit-panel .designer-input-container .icon-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 5px;
  cursor: pointer;
  width: 20px;
  color: #fff;
  font-size: 20px;
}

#multi-edit-panel .designer-input-container .icon-button:hover {
  color: #007bff;
}

#multi-edit-panel .tags-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 85%;
}

#multi-edit-panel .tags-input-container .icon-button {
  background: none;
  border: none;
  padding: 0;
  margin-left: 5px;
  cursor: pointer;
  width: 20px;
  color: #fff;
  font-size: 20px;
}

#multi-edit-panel .tags-input-container .icon-button:hover {
  color: #007bff;
}

.welcome-dialog {
  border: none;
  border-radius: 8px;
  padding: 20px;
  background-color: #2a2a2a;
  color: white;
  max-width: 400px;
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0; /* Start fully transparent */
  }
  to {
    opacity: 1; /* End fully opaque */
  }
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-content h2 {
  color: #fff;
  margin: 0;
  font-size: 24px;
}

.welcome-content p {
  color: #ccc;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

#dismiss-welcome {
  background: var(--primary-accent, #00d4ff);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  width: auto;
  margin-top: 20px;
  transition: background-color 0.15s ease;
  box-shadow: none;
}

#dismiss-welcome:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

/* Remove the old welcome message styles */
.welcome-message {
  display: none;
}

/* Remove the old multi-edit panel button styles */
#multi-edit-panel .designer-input-container .icon-button,
#multi-edit-panel .tags-input-container .icon-button {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background-color 0.2s ease;
}

#multi-edit-panel .designer-input-container .icon-button:hover,
#multi-edit-panel .tags-input-container .icon-button:hover {
  background: #0056b3;
}

/* Make all input containers consistent */
#multi-edit-panel .designer-input-container,
#multi-edit-panel .tags-input-container {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  min-width: 0;
}

#multi-edit-panel .designer-input-container select,
#multi-edit-panel .tags-input-container select {
  flex: 1;
  margin-right: 0;
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* SIMPLIFIED: #multi-edit-panel select options inherit from global select option rules */

/* Make all buttons consistent - smaller size */
.icon-button {
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color 0.15s ease;
  box-shadow: none;
  flex-shrink: 0;
  align-self: center;
}

.icon-button:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

.dedup-dialog {
  min-width: 800px;
  max-width: 90vw;
  max-height: 80vh;
}

.dedup-scope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0.6rem 0 0.2rem;
}

.dedup-scope-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ccc;
}

.dedup-scope-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #ddd;
  cursor: pointer;
}

.dedup-scope-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dedup-scope-summary {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.85rem;
  color: #9ad;
}

.dedup-space-saved {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin: 0.55rem 0 0.15rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.22);
  font-size: 0.9rem;
}

.dedup-space-saved-label {
  font-weight: 600;
  color: #9ad;
}

#dedup-space-saved-bytes {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.dedup-space-saved-files {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

.dedup-preferred {
  margin: 0.55rem 0 0.15rem;
}

.dedup-preferred-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.25rem;
}

#dedup-dialog .dedup-preferred-row input {
  flex: 1 1 16rem;
  min-width: 12rem;
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  background-image: none;
  color: #fff;
  font-size: 13px;
}

#dedup-dialog .dedup-preferred-row input:focus {
  outline: none;
  border-color: var(--primary-accent, #00d4ff);
}

#dedup-dialog .dedup-preferred-row button {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.dedup-dialog .duplicate-groups {
  max-height: calc(80vh - 120px);
  overflow-y: auto;
}

.dedup-virtual-spacer {
  position: relative;
  width: 100%;
}

.dedup-virtual-content {
  width: 100%;
}

.dedup-virtual-summary {
  padding: 8px 10px;
  color: #888;
  font-size: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--dialog-background, #1e1e1e);
}

/* Fullscreen toggle button for DeDup and Tag Manager modals */
.modal-fullscreen-toggle {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}
.modal-fullscreen-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Modal fullscreen state — inset:0 so native <dialog> actually fills the viewport */
.modal.modal-fullscreen {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  inset: 0;
  border-radius: 0;
  padding: 24px;
  box-sizing: border-box;
}
.modal.modal-fullscreen form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.dedup-dialog.modal-fullscreen .duplicate-groups {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  margin-top: 0.5rem;
}
#tag-manager-dialog.modal-fullscreen {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  inset: 0;
  overflow: hidden;
}
#tag-manager-dialog.modal-fullscreen form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#tag-manager-dialog.modal-fullscreen .tag-manager-existing-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tag-manager-dialog.modal-fullscreen #tag-manager-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}
#filament-manager-dialog.modal-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  inset: 0 !important;
  border-radius: 0 !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  overflow: hidden;
}
#filament-manager-dialog.modal-fullscreen form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#filament-manager-dialog.modal-fullscreen form .filament-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#filament-manager-dialog.modal-fullscreen #filament-manager-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}
#parts-stock-dialog.modal-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  inset: 0 !important;
  border-radius: 0 !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  overflow: hidden;
}
#parts-stock-dialog.modal-fullscreen form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#parts-stock-dialog.modal-fullscreen .parts-stock-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#parts-stock-dialog.modal-fullscreen #parts-stock-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}
#printer-management-dialog.modal-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  inset: 0 !important;
  border-radius: 0 !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
#printer-management-dialog.modal-fullscreen .printer-management-scroll-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.duplicate-group {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #333;
}

.duplicate-preview {
  flex: 0 0 150px;
  height: 150px;
  background: var(--model-background-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.duplicate-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.duplicate-files {
  flex: 1;
  overflow-y: auto;
  max-height: 150px;
}

.duplicate-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #2a2a2a;
  margin-bottom: 3px;
  border-radius: 4px;
}

.duplicate-file input[type="checkbox"] {
  margin: 0;
}

.duplicate-file-path {
  margin-left: 10px;
  color: var(--text-color);
  max-width: 800px;
  text-overflow: ellipsis;
  display: inline-block;
  font-size: 10px;
  word-wrap: break-word;
  word-break: break-all;
  white-space: normal;
}

.duplicate-file-size {
  margin-left: auto;
  color: #777;
}

.duplicate-file.zip-entry {
  opacity: 0.7;
  background: #1f1f1f;
}

.duplicate-file.zip-entry input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.zip-entry-badge {
  display: inline-block;
  background: #4a90e2;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  margin-right: 6px;
  vertical-align: middle;
}

.duplicate-file.preferred-directory {
  outline: 1px solid rgba(32, 201, 151, 0.55);
}

.preferred-directory-badge {
  display: inline-block;
  background: #1aa179;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  margin-right: 6px;
  vertical-align: middle;
}

.no-duplicates {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 16px;
}

.error-message {
  color: #ff6b6b;
  text-align: center;
  padding: 20px;
  font-size: 16px;
}

.model-count {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 15px;
  letter-spacing: 0.02em;
}

.model-stats {
  margin-bottom: 15px;
  text-align: center;
}

.model-count {
  color: #999;
  font-size: 14px;
  margin: 2px 0;
}

.progress-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.progress-button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  background: #444;
  color: #fff;
  transition: background 0.2s;
  width: auto;
  margin: 0;
}

.progress-button:hover {
  background: #555;
}

#stop-scan, #stop-render {
  background: #dc3545;
}

#stop-scan:hover, #stop-render:hover {
  background: #c82333;
}

.progress-section {
  width: 85%;
  padding: 10px 20px;
  margin-bottom: 15px;
}

.progress-section .progress-container {
  margin-bottom: 10px;
}

/* Tag Manager Styles */
#tag-manager-dialog {
  min-width: 400px;
}

#tag-manager-dialog .modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  flex-shrink: 0;
}

#tag-manager-dialog .modal-header-row h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.modal-fullscreen-icon-btn {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

#tag-manager-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

#tag-manager-dialog .dialog-buttons button {
  width: auto;
  min-width: 88px;
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 20px;
}

.modal-fullscreen-icon-btn svg {
  display: block;
  width: 16px;
  height: 16px;
}

.modal-fullscreen-icon-btn .fullscreen-icon-shrink {
  display: none;
}

.modal.modal-fullscreen .modal-fullscreen-icon-btn .fullscreen-icon-expand {
  display: none;
}

.modal.modal-fullscreen .modal-fullscreen-icon-btn .fullscreen-icon-shrink {
  display: block;
}

#tag-manager-search {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

#tag-manager-search:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

#tag-manager-search::placeholder {
  color: #999;
}

#clear-tag-search {
  opacity: 0.7;
  transition: opacity 0.2s;
}

#clear-tag-search:hover {
  opacity: 1;
}

#tag-manager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  width: 100%;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
}

#tag-manager-list .tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(91, 159, 255, 0.2) 100%);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(0, 150, 200, 0.5);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  max-width: 100%;
  overflow: hidden;
}

#tag-manager-list .tag .tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  cursor: text;
}

#tag-manager-list .tag .tag-edit-input {
  flex: 1;
  min-width: 4em;
  max-width: 220px;
  margin: 0;
  padding: 0 4px;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  font: inherit;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.6);
}

.tag-manager-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
}

#multi-edit-panel .tags-container > .full-width-button {
  width: 100%;
  max-width: none;
  margin: 8px 0 0;
}

#tag-manager-list .tag:hover {
  background: linear-gradient(135deg, rgba(0, 150, 200, 0.5) 0%, rgba(91, 159, 255, 0.3) 100%);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
}

#tag-manager-list .tag:has(.tag-edit-input) {
  overflow: visible;
}

#tag-manager-list .tag:has(.tag-edit-input):hover {
  transform: none;
}

#tag-manager-list .tag .tag-count {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 4px;
}

#tag-manager-list .tag .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s;
}

#tag-manager-list .tag .tag-remove:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

#new-tag-manager-name {
  flex: 1;
  padding: 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
}

/* Filament Management */
/* Filament Management Dialog — styled to match Parts Stock */
#filament-manager-dialog {
  min-width: 580px;
  max-width: 860px;
  width: 92%;
  border-radius: 20px;
  background: rgba(24, 24, 38, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 24px 28px;
}

#filament-manager-dialog * {
  box-sizing: border-box;
}

#filament-manager-dialog [hidden] {
  display: none !important;
}

/* Header */
.filament-manager-header {
  margin-bottom: 18px;
}

.filament-manager-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.filament-manager-header-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filament-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filament-header-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer;
  height: 30px !important;
  width: auto !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease !important;
}

.filament-header-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
}

.filament-manager-header .setting-description {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

/* Spoolman Setup Card */
.spoolman-setup-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.spoolman-setup-panel[hidden] {
  display: none !important;
}

.spoolman-section-header {
  margin-bottom: 12px;
}

.spoolman-section-header label {
  font-size: 13.5px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.01em;
  margin: 0;
}

.spoolman-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  width: 100%;
}

.filament-spoolman-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.spoolman-btn {
  flex: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 8px 16px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  height: 36px;
  width: auto !important;
  margin: 0 !important;
  transition: all 0.2s ease !important;
}

.spoolman-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.spoolman-btn-primary {
  background: var(--primary-accent, #00d4ff) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.spoolman-btn-primary:hover {
  transform: none;
  background: var(--primary-accent-hover, #5b9fff) !important;
  box-shadow: none !important;
}

/* Filament Form Section */
.filament-form-section {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-sizing: border-box;
}

.filament-form-section.collapsed {
  padding: 10px 18px !important;
  margin-bottom: 14px !important;
}

.filament-form-section.collapsed .filament-section-header {
  margin-bottom: 0 !important;
}

.filament-toggle-add-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  line-height: 1 !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  transition: all 0.2s ease !important;
}

.filament-toggle-add-btn:hover {
  background: rgba(56, 189, 248, 0.24) !important;
  color: #fff !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
}

.filament-toggle-add-btn.active {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
}

.filament-toggle-add-btn.active:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.filament-btn-cancel {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px 18px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  cursor: pointer;
  height: 38px;
  line-height: 1;
  transition: all 0.2s ease !important;
}

.filament-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
}

.filament-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#filament-form-label {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.01em;
  margin: 0;
}

.filament-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  width: 100%;
}

.filament-span {
  grid-column: 1 / -1;
}

.filament-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.filament-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}

.filament-field-label .required {
  color: #38bdf8;
  margin-left: 2px;
}

/* Strip select arrows, paddings, and styles inherited from styles.css */
#filament-manager-dialog .form-group input,
#filament-manager-dialog input[type="text"],
#filament-manager-dialog input[type="password"],
#filament-manager-dialog input[type="number"] {
  background-image: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
  font-size: 13.5px !important;
  line-height: 1.4 !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
}

#filament-manager-dialog .form-group input:focus,
#filament-manager-dialog input[type="text"]:focus,
#filament-manager-dialog input[type="password"]:focus,
#filament-manager-dialog input[type="number"]:focus {
  outline: none !important;
  border-color: #00d4ff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18) !important;
}

#filament-manager-dialog input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

#filament-manager-dialog input[type="number"]::-webkit-inner-spin-button,
#filament-manager-dialog input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#filament-manager-dialog input[type="number"] {
  -moz-appearance: textfield;
}

/* Color Row */
.filament-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.filament-color-row input[type="color"] {
  width: 44px !important;
  height: 40px !important;
  min-width: 44px !important;
  padding: 2px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  cursor: pointer;
  flex-shrink: 0;
}

.filament-color-row input[type="text"] {
  flex: 1;
}

/* Filament Form Actions - Full Width */
#filament-manager-dialog button:not(.modal-fullscreen-icon-btn) {
  margin-bottom: 0;
  box-shadow: none;
}

#filament-manager-dialog .modal-fullscreen-icon-btn {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.filament-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
  width: 100%;
}

.filament-btn-primary {
  width: 100% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 10px 22px !important;
  background: var(--primary-accent, #00d4ff) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
  height: 38px;
  line-height: 1;
  transition: background-color 0.15s ease !important;
  box-shadow: none !important;
}

.filament-btn-primary:hover {
  transform: none;
  background: var(--primary-accent-hover, #5b9fff) !important;
  box-shadow: none !important;
}

.filament-btn-primary:active {
  transform: none;
}

.filament-manager-status {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #38bdf8;
  min-height: 1.2em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filament-manager-status:empty {
  margin-top: 0;
  min-height: 0;
}

.filament-manager-status.error {
  color: #f87171;
}

/* Filament List Section */
.filament-list-section {
  margin-bottom: 8px;
  width: 100%;
}

.filament-list-section .filament-section-header {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filament-list-section label {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.01em;
  margin: 0;
}

.filament-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.filament-count-badge:empty {
  display: none;
}

#filament-manager-dialog .input-with-icon {
  width: 100% !important;
  position: relative;
  margin-bottom: 10px;
}

#filament-manager-dialog .input-with-icon input#filament-manager-search {
  width: 100% !important;
  padding-right: 40px !important;
}

#filament-manager-dialog .input-with-icon #clear-filament-search {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 15px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease !important;
}

#filament-manager-dialog .input-with-icon #clear-filament-search:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
}

#filament-manager-list,
.filament-manager-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(14, 14, 24, 0.5);
  width: 100%;
}

.filament-manager-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #64748b;
  padding: 26px 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

/* Filament List Row Item */
.filament-manager-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.2s ease;
  width: 100%;
}

.filament-manager-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.filament-manager-item .filament-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.filament-manager-item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filament-manager-item-name {
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filament-manager-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #94a3b8;
  font-size: 11px;
}

.filament-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
}

.filament-tag.material {
  background: rgba(0, 212, 255, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.filament-source-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(0, 212, 255, 0.25);
  white-space: nowrap;
}

.filament-source-badge.manual {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.filament-count {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.filament-remove {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  border-radius: 8px !important;
  font-size: 18px !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

.filament-remove:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
}

/* Full-width Close button spanning entire dialog at bottom */
#filament-manager-dialog .dialog-buttons {
  margin-top: 18px;
  width: 100%;
  display: flex;
}

#filament-manager-close {
  width: 100% !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 12px !important;
  padding: 10px 24px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  height: 40px !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease !important;
}

#filament-manager-close:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
}
.filament-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  display: inline-block;
}
.filament-chip,
.filament-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin: 2px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
  font-size: 12px;
}
.filament-chip-remove {
  cursor: pointer;
  padding: 0 4px;
}
.filament-filter-link {
  cursor: pointer;
}
.tags-list .filament-chip {
  margin: 0;
  font-size: 14px;
}

/* Metadata Editor Dialog */
#metadata-editor-dialog {
  min-width: 500px;
}

#metadata-editor-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

#server-mode-info-dialog .dialog-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.metadata-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #555;
}

.metadata-tab {
  padding: 8px 16px;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.metadata-tab:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.metadata-tab.active {
  color: #fff;
  font-weight: bold;
  border-bottom-color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

#metadata-editor-search {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

#metadata-editor-search:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

#metadata-editor-search::placeholder {
  color: #999;
}

#clear-metadata-search {
  opacity: 0.7;
  transition: opacity 0.2s;
}

#clear-metadata-search:hover {
  opacity: 1;
}

#metadata-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 32px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  width: 100%;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: auto;
}

.metadata-item:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.metadata-name {
  flex: 1;
  color: #fff;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: inline-block;
  padding-right: 8px;
  line-height: 1.4;
}

.metadata-count {
  background: var(--primary-accent, #00d4ff);
  color: #fff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(91, 159, 255, 0.3);
}

.metadata-rename,
.metadata-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  border: none;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  transition: all 0.2s;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.metadata-rename {
  font-size: 14px;
}

.metadata-rename:hover {
  background-color: rgba(0, 123, 255, 0.3);
  color: #007bff;
}

.metadata-delete:hover {
  background-color: rgba(220, 53, 69, 0.3);
  color: #dc3545;
}

#metadata-editor-list .no-metadata,
#metadata-editor-list .error-message {
  padding: 16px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Thumbnail navigation overlay for multiple thumbnails in detailed view */
.thumbnail-wrapper {
  position: relative;
  display: inline-block;
}

.thumbnail-nav-left,
.thumbnail-nav-right {
  position: absolute;
  top: 0;
  height: 100%;
  background: transparent;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.thumbnail-wrapper:hover .thumbnail-nav-left,
.thumbnail-wrapper:hover .thumbnail-nav-right,
.parent-model-group-thumbnail:hover .thumbnail-nav-left,
.parent-model-group-thumbnail:hover .thumbnail-nav-right {
  opacity: 1;
}

.thumbnail-nav-left {
  left: 0;
  width: 50px;
  max-width: 50px;
  cursor: pointer;
}

.thumbnail-nav-right {
  right: 0;
  width: 50px;
  max-width: 50px;
  cursor: pointer;
}

.thumbnail-nav-left:hover {
  background: rgba(0, 0, 0, 0.3);
}

.thumbnail-nav-right:hover {
  background: rgba(0, 0, 0, 0.3);
}

.thumbnail-nav-left::before {
  content: '◀';
  color: rgba(255, 255, 255, 0.5);
  font-size: 32px;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.thumbnail-nav-right::after {
  content: '▶';
  color: rgba(255, 255, 255, 0.5);
  font-size: 32px;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.thumbnail-nav-left:hover::before {
  color: rgba(255, 255, 255, 0.9);
}

.thumbnail-nav-right:hover::after {
  color: rgba(255, 255, 255, 0.9);
}

.thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--model-background-color);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: context-menu;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.thumbnail-menu-button {
  position: absolute;
  bottom: 6px;
  left: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  margin: 0;
  line-height: 1;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid #666;
  color: #fff;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: none;
  overflow: visible;
}

.thumbnail-menu-button:hover {
  transform: none;
}

.thumbnail-menu-button::before {
  display: none;
}

.thumbnail-container:hover .thumbnail-menu-button {
  opacity: 1;
  pointer-events: auto;
}

.thumbnail-container:hover {
  outline: 2px solid rgba(0, 150, 200, 0.5);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.2);
  transform: scale(1.02);
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

.file-info {
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

#select-all-button {
  margin: 8px 16px 12px;
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #3a3a3a;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: calc(100% - 32px);
  max-width: none;
  box-sizing: border-box;
}

#select-all-button:hover {
  background-color: #3a3a3a;
}

.tag-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.refresh-tags-button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: transform 0.2s ease;
}

.refresh-tags-button:hover {
  color: #4a9eff;
}

/* ============================================
   TERMS OF SERVICE DIALOG - MODERN STYLING
   ============================================ */

.tos-dialog {
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
}

.tos-dialog-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.tos-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 2rem 1rem 2rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(91, 159, 255, 0.05) 100%);
  flex-shrink: 0;
}

.tos-logo {
  width: 60px;
  height: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 212, 255, 0.3));
  transition: transform 0.3s ease;
}

.tos-logo:hover {
  transform: scale(1.05);
}

.tos-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  background: var(--primary-accent, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tos-body {
  flex: 1;
  overflow: visible;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tos-scroll-content {
  flex: 1;
  overflow: visible;
  padding: 1.5rem 2rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* Custom scrollbar for TOS content */
.tos-scroll-content::-webkit-scrollbar {
  width: 8px;
}

.tos-scroll-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.tos-scroll-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.5) 0%, rgba(91, 159, 255, 0.5) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.tos-scroll-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.7) 0%, rgba(91, 159, 255, 0.7) 100%);
  background-clip: padding-box;
}

.tos-scroll-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #fff;
  letter-spacing: -0.01em;
}

.tos-copyright {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  font-weight: 500;
}

.tos-scroll-content p {
  margin: 0 0 0.75rem 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  font-size: 13px;
}

.tos-warning {
  background: rgba(255, 152, 0, 0.1);
  border-left: 3px solid #ff9800;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1rem 0 !important;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 12px;
  line-height: 1.4;
}

.tos-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.tos-button {
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 120px;
  letter-spacing: 0.02em;
}

.tos-button-accept {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.tos-button-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, #5ae890 0%, #2dd66f 100%);
}

.tos-button-accept:active {
  transform: translateY(0);
}

.tos-button-decline {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tos-button-decline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tos-button-decline:active {
  transform: translateY(0);
}

/* Legacy support for old class names */
.tos-content {
  margin: 20px 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
}

.tos-text {
  padding: 20px;
  color: rgba(255, 255, 255, 0.95);
}

.tos-text h3 {
  margin-top: 0;
  color: #fff;
}

.tos-text h4 {
  color: #4a9eff;
  margin-top: 20px;
}

.tos-text p {
  line-height: 1.7;
  margin-bottom: 15px;
}

.tos-text ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.tos-text li {
  margin-bottom: 8px;
}

#decline-terms {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

#decline-terms:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

#accept-terms {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

#accept-terms:hover {
  background: linear-gradient(135deg, #5ae890 0%, #2dd66f 100%);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* Legacy about-tos styles for server-mode-info-dialog */
.about-tos {
  margin-top: 20px;
  border-top: 1px solid rgba(74, 158, 255, 0.2);
  padding-top: 20px;
}

.about-tos h3 {
  color: #4a9eff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.about-tos-content {
  max-height: 200px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
  line-height: 1.6;
}

.about-tos-content h4 {
  color: #4a9eff;
  margin: 12px 0 8px 0;
  font-weight: 600;
}

.about-tos-content p {
  margin-bottom: 12px;
  color: #e0e0e0;
}

.about-tos-content ul {
  margin: 8px 0 12px 24px;
}

.about-tos-content li {
  margin-bottom: 8px;
  color: #d0d0d0;
}

/* Modern About Dialog */
#about-dialog {
  width: 95%;
  max-width: 1000px;
  max-height: 85vh;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(74, 158, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#about-dialog form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.about-header {
  text-align: center;
  padding: 32px 32px 24px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(74, 158, 255, 0.05) 100%);
  border-bottom: 1px solid rgba(74, 158, 255, 0.2);
  position: relative;
}

.about-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 10;
}

.about-close-x:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.about-close-x:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.15);
}

.about-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
}

.about-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.about-version-text {
  margin: 0;
  font-size: 14px;
  color: #a0a0a0;
  font-weight: 500;
}

.about-content {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
}

.about-main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.about-terms-column {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-terms-card {
  position: sticky;
  top: 0;
  max-height: calc(85vh - 250px);
  overflow-y: auto;
  height: fit-content;
  padding: 16px;
}

.about-terms-card .about-card-content {
  max-height: none;
  gap: 10px;
}

.about-terms-list {
  max-height: none;
  overflow: visible;
}

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

.about-primary-button {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.about-primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
  background: linear-gradient(135deg, #5aaeff 0%, #458acd 100%);
}

.about-primary-button:active {
  transform: translateY(0);
}

.button-icon {
  font-size: 18px;
}

.about-options-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.about-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.about-option-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.about-option-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4a9eff;
}

.about-option-item label {
  font-size: 14px;
  color: #e0e0e0;
  cursor: pointer;
  user-select: none;
}

.about-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.about-link-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.link-icon {
  font-size: 20px;
}

.about-link {
  color: #4a9eff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.about-link:hover {
  color: #6abeff;
  text-decoration: underline;
}

.about-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.about-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(74, 158, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.about-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-icon {
  font-size: 24px;
}

.about-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.about-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-card-description {
  margin: 0;
  font-size: 12px;
  color: #b0b0b0;
  line-height: 1.5;
}

.about-terms-list {
  margin: 8px 0 0 0;
  padding-left: 24px;
  list-style: none;
  counter-reset: term-counter;
}

.about-terms-list li {
  position: relative;
  margin: 8px 0;
  padding-left: 8px;
  font-size: 12px;
  color: #c0c0c0;
  line-height: 1.5;
}

.about-terms-list li::before {
  content: "•";
  position: absolute;
  left: -20px;
  color: #4a9eff;
  font-weight: bold;
  font-size: 16px;
}

/* About dialog close button removed - using X in header */

/* Server Mode Info dialog - fill width */
#server-mode-info-dialog {
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  padding: 20px 0 20px 20px;
}

#server-mode-info-dialog .about-content {
  padding: 0;
  max-width: none;
}

/* Stats Dialog Styles */
#stats-dialog {
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  padding: 20px;
}

.stats-content {
  padding: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0;
}

.stats-section {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(74, 158, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.stats-section h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #4a9eff;
  border-bottom: 1px solid rgba(74, 158, 255, 0.2);
  padding-bottom: 4px;
}

.stats-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.stats-summary h3 {
  grid-column: 1;
  margin: 0;
}

.stats-summary .stats-value-large {
  grid-column: 2;
  text-align: right;
}

.stats-subsection {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-chart-section {
  display: flex;
  flex-direction: column;
}

.stats-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-space-saved .stats-value-large {
  text-align: left;
  margin: 2px 0 6px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.stats-row-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.stats-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.stats-label {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 500;
}

.stats-label-small {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 500;
}

.stats-label-tiny {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 500;
}

.stats-value {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

.stats-value-large {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  text-align: right;
}

.stats-value-small {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.stats-bytes {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.stats-value-tiny {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.stats-description {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: #a0a0a0;
  font-style: italic;
}

.chart-container {
  margin: 16px 0;
  height: 200px;
  position: relative;
}

.chart-container-small {
  margin: 8px 0;
  height: 120px;
  position: relative;
}

.chart-container canvas {
  max-height: 200px;
}

.chart-container-small canvas {
  max-height: 120px;
}

/* Add these rules to hide the save buttons */
#save-model-button,
#save-multi-edit-button,
#multi-save-button {
  display: none !important;
}

/* Add styles for the multi-edit mode buttons - match filter section width */
#enter-multi-edit-button,
#exit-multi-edit-button {
  margin: 8px 16px 12px;
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #3a3a3a;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: calc(100% - 32px);
  max-width: none;
  box-sizing: border-box;
}

#enter-multi-edit-button:hover,
#exit-multi-edit-button:hover {
  background-color: #3a3a3a;
}

/* Hide the old edit mode toggle button */
#edit-mode-toggle {
  display: none !important;
}

:root {
  --model-background-color: #070147;  /* Default color */
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  /* Preserve hexagon pattern background */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  background-position: 0 0;
}

.file-item {
  position: relative;
  background: #2a2a2a;
  border-radius: 12px;
  padding: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.file-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-item.selected {
  outline: 3px solid #4a9eff;
  background: #333;
}

.thumbnail-container {
  position: relative;
  width: 100%;
  height: 250px;
  background: var(--model-background-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.error-message {
  color: #ff6b6b;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.file-info {
  padding: 8px 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.5;
}

@keyframes loading {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.loading .thumbnail-container {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200px 100%;
  animation: loading 1.5s infinite;
}

.print-status {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.print-status:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.05);
}

.print-status.printed {
  background: rgba(46, 204, 113, 0.6);
}

.print-status.printed:hover {
  background: rgba(46, 204, 113, 0.85);
}

.print-status-want,
.file-grid .print-status-want,
.file-item-list .print-status-want {
  background: rgba(155, 89, 182, 0.7);
}
.print-status-want:hover,
.file-grid .print-status-want:hover,
.file-item-list .print-status-want:hover {
  background: rgba(155, 89, 182, 0.9);
}
.print-status-queued,
.file-grid .print-status-queued,
.file-item-list .print-status-queued {
  background: rgba(241, 196, 15, 0.8);
  color: #1a1a1a;
}
.print-status-queued:hover,
.file-grid .print-status-queued:hover,
.file-item-list .print-status-queued:hover {
  background: rgba(241, 196, 15, 0.95);
}
.print-status-printing,
.file-grid .print-status-printing,
.file-item-list .print-status-printing {
  background: rgba(52, 152, 219, 0.75);
}
.print-status-printing:hover,
.file-grid .print-status-printing:hover,
.file-item-list .print-status-printing:hover {
  background: rgba(52, 152, 219, 0.95);
}
.print-status-failed,
.file-grid .print-status-failed,
.file-item-list .print-status-failed {
  background: rgba(231, 76, 60, 0.75);
}
.print-status-failed:hover,
.file-grid .print-status-failed:hover,
.file-item-list .print-status-failed:hover {
  background: rgba(231, 76, 60, 0.95);
}
.print-status-mixed,
.file-grid .print-status-mixed,
.file-item-list .print-status-mixed {
  background: rgba(230, 126, 34, 0.75);
}
.print-status-mixed:hover {
  background: rgba(230, 126, 34, 0.95);
}

.print-lifecycle-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  margin-bottom: 0;
}
.print-lifecycle-controls select,
.model-details #model-print-status {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  margin-right: 0;
  box-sizing: border-box;
}
#log-print-button,
.log-print-icon-button {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: hidden;
}
#log-print-button::before,
.log-print-icon-button::before {
  display: none;
}
#log-print-button svg,
.log-print-icon-button svg {
  display: block;
  flex-shrink: 0;
}
.print-history-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #aaa;
  min-height: 1em;
}
.print-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
.print-history-empty {
  color: #888;
  font-size: 13px;
  padding: 8px 0;
}
.print-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 6px;
  row-gap: 2px;
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid rgba(46, 204, 113, 0.8);
}
.print-history-item.outcome-failed {
  border-left-color: rgba(231, 76, 60, 0.9);
}
.print-history-item.outcome-cancelled {
  border-left-color: rgba(149, 165, 166, 0.9);
}
.print-history-item-main,
.print-history-filaments,
.print-history-parts,
.print-history-notes {
  grid-column: 1;
  min-width: 0;
}
.print-history-item-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.print-history-outcome {
  font-weight: 600;
  flex-shrink: 0;
}
.print-history-when,
.print-history-filaments,
.print-history-parts,
.print-history-notes {
  font-size: 12px;
  color: #bbb;
  margin-top: 2px;
}
.print-history-when {
  text-align: right;
  overflow-wrap: anywhere;
}
.print-history-delete.icon-button {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  position: static;
  top: auto;
  right: auto;
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  box-shadow: none;
}
.print-history-delete.icon-button:hover {
  transform: none;
}
.print-status-menu {
  position: fixed;
  z-index: 10000;
  min-width: 140px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 4px;
}
.print-status-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #eee;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.print-status-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#log-print-dialog {
  min-width: 420px;
}
#log-print-dialog textarea {
  min-height: 72px;
  width: 100%;
}

.setting-description {
  color: #888;
  font-size: 0.9em;
  margin: 5px 0 10px 0;
}

#browser-extension-settings-dialog .setting-description a {
  color: #7eb8f7;
  text-decoration: underline;
}
#browser-extension-settings-dialog .setting-description a:hover {
  color: #a8d4ff;
}

#mcp-server-settings-dialog [hidden] {
  display: none !important;
}

#https-settings-dialog [hidden],
#https-settings-dialog .tls-mode-panel[hidden] {
  display: none !important;
}
#https-settings-dialog .mcp-inline-actions {
  margin-top: 8px;
  margin-bottom: 0;
  justify-content: flex-start;
}
#https-settings-dialog .mcp-inline-actions button {
  width: auto;
  margin-bottom: 0;
}
#https-settings-dialog #https-settings-status {
  width: 85%;
  padding: 0 20px;
  box-sizing: border-box;
}
#https-settings-dialog input[type="text"],
#https-settings-dialog input[type="email"] {
  background-image: none;
  padding-right: 16px;
}
#https-settings-dialog .checkbox-container label a {
  pointer-events: auto;
  color: #7eb8f7;
}
#https-settings-fields[data-disabled="1"] {
  opacity: 0.65;
  pointer-events: none;
}
#mcp-server-settings-dialog .mcp-inline-actions {
  margin-top: 8px;
  margin-bottom: 0;
  justify-content: flex-start;
}
#mcp-server-settings-dialog .mcp-inline-actions button {
  width: auto;
  margin-bottom: 0;
}
#mcp-server-settings-dialog #mcp-server-status {
  width: 85%;
  padding: 0 20px;
  box-sizing: border-box;
}
#mcp-server-settings-dialog pre.mcp-config {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d6e4f0;
  padding: 12px 16px;
  border-radius: 12px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.4;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  box-sizing: border-box;
}
#mcp-server-settings-dialog #mcp-server-url {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background-image: none;
  padding-right: 16px;
}

.full-width-button {
  width: 100%;
  max-width: 240px; /* Match filter section width */
  padding: 8px;
  margin: 5px 0;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  box-sizing: border-box;
}

.full-width-button:hover {
  background: #3a3a3a;
}

.duplicate-group {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #333;
}

.duplicate-preview {
  flex: 0 0 150px;
  height: 150px;
  background: var(--model-background-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.duplicate-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.duplicate-files {
  flex: 1;
  overflow-y: auto;
  max-height: 150px;
}

.duplicate-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #2a2a2a;
  margin-bottom: 3px;
  border-radius: 4px;
}

.duplicate-file input[type="checkbox"] {
  margin: 0;
}

.duplicate-file-path {
  flex: 1;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  word-break: break-all;
}

.duplicate-file-size {
  flex: 0 0 80px;
  text-align: right;
  color: #888;
}

.duplicate-file.zip-entry {
  opacity: 0.7;
  background: #1f1f1f;
}

.duplicate-file.zip-entry input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.zip-entry-badge {
  display: inline-block;
  background: #4a90e2;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: bold;
  margin-right: 6px;
  vertical-align: middle;
}

.dedup-dialog {
  min-width: 800px;
  max-width: 90vw;
}

#view-library-button {
  width: 90%;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  box-shadow: none;
}

#view-library-button:hover {
  background: var(--surface-raised, #2a2a3c);
  border-color: var(--border-strong, rgba(255, 255, 255, 0.16));
  transform: none;
  box-shadow: none;
}

#scan-directory-button {
  width: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}

.progress-section hidden {
  display: none;
}

.progress-container {
  margin-bottom: 10px;
}

.progress-bar {
  height: 20px;
  background-color: #444;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #4a9eff;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: center;
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  margin-top: 4px;
  padding: 0;
  line-height: 1.4;
  min-height: 18px;
}

.performance-notice {
  color: #888;
  font-size: 0.8em;
  text-align: center;
  margin-top: 5px;
  font-style: italic;
}

.danger-button {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.danger-button:hover {
  background-color: #c82333;
}

.easy-button {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.easy-button:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.warning-text {
  color: #ff6b6b;
  font-size: 0.9em;
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 4px;
}

#settings-dialog input[type="number"] {
  width: 80px;
}

@keyframes winner-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(74, 158, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74, 158, 255, 0); }
}

.roulette-winner {
  animation: winner-pulse 0.5s ease-in-out 3;
}

.file-item {
  transition: all 0.2s ease-in-out;
}

/* Old about dialog styles removed - using modern styles above */

.welcome-dialog {
  border: none;
  border-radius: 16px;
  padding: 32px;
  background: var(--surface, #1e1e2e);
  color: white;
  max-width: 400px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
}

.welcome-content {
  text-align: center;
}

.welcome-content h2 {
  margin-bottom: 15px;
}

.welcome-content p {
  margin-bottom: 20px;
  line-height: 1.5;
}

.welcome-content button {
  padding: 8px 20px;
  margin: 5px;
  border: none;
  border-radius: 4px;
  background: #4a9eff;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.welcome-content button:hover {
  background: #3a8eef;
}

/* Add specific styles for update dialog buttons */
#update-now-button {
  background: #4a9eff;
}

#update-later-button {
  background: #666;
}

#update-later-button:hover {
  background: #777;
}

.parent-directory {
  font-size: 12px;
  color: #4a9eff; /* Make it look like a link */
  margin: 4px 0;
  cursor: pointer; /* Indicate it's clickable */
}

.parent-directory:hover {
  text-decoration: underline; /* Add underline on hover */
}

.directory-label {
  color: #666;
}

.directory-link {
  color: #4a9eff;
  text-decoration: none;
  cursor: pointer;
}

.directory-link:hover {
  text-decoration: underline;
}

/* Designer info styling to match parent directory */
.designer-info {
  font-size: 12px;
  color: #4a9eff;
  margin: 4px 0;
  cursor: pointer;
}

.designer-info:hover {
  text-decoration: underline;
}

#current-filter {
  padding: 8px 10px 10px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 8px;
  background: rgba(74, 158, 255, 0.1);
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  display: none;
  align-self: stretch;
  flex-shrink: 0;
  overflow: visible;
}

#current-filter.visible {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* Cap height when details are open, but never crush the pill list. */
.sidebar.details-open #current-filter.visible {
  max-height: 40vh;
  overflow-x: hidden;
  overflow-y: auto;
  flex-shrink: 0;
  min-height: auto;
}

#current-filter-body {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.filter-count,
.no-results {
  margin: 0;
  line-height: 1.4;
  overflow: visible;
}

#clear-all-filters-button.clear-filter-button {
  margin-left: 0;
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
}

.clear-filter-button {
  margin-left: 10px;
  margin-top: 5px;
  padding: 2px 8px;
  background: #4a9eff;
  border: none;
  border-radius: 3px;
  color: white;
  cursor: pointer;
  font-size: 12px;
}

.clear-filter-button:hover {
  background: #3a8eef;
}

/* New styles for the icon buttons container and buttons */
.icon-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 8px;
  background: transparent;
  border-radius: 12px;
  border: none;
}

.icon-buttons-container .icon-button {
  width: 46px;
  height: 46px;
  padding: 8px;
  margin-left: 0;
  margin-right: 0;
  flex: 0 0 46px;
  background: var(--surface-raised, #2a2a3c);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-buttons-container .icon-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(1.1);
}

.icon-buttons-container .icon-button:hover {
  transform: none;
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 16%, var(--surface-raised, #2a2a3c));
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 45%, transparent);
  box-shadow: none;
}

.icon-buttons-container .icon-button:active {
  transform: none;
}

/* Spinner overlay styles */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-overlay .spinner p {
  margin-top: 20px;
  font-size: 20px;
  color: #fff;
}

/* Added custom style for the #continue-anyways button */
#continue-anyways {
    font-size: 10px;
    padding: 4px 8px;
    background-color: rgba(68, 68, 68, 0.3);
    color: #fff;
    border: 2px solid rgba(68, 68, 68, 0.3);
    border-radius: 4px;
    width: 15%;
}

/* Tag filter dropdown styling - removed old conflicting width rule */
/* Now uses the same styling as other filter dropdowns via .sidebar .dropdown-with-list select */

/* Ensure the container for the tag filter stays neat */
.tags-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Make sure the refresh button is sized and aligned properly */
.tags-input-container .refresh-tags-button {
  width: 32px;
  height: 32px;
  padding: 4px;
  flex-shrink: 0;
}

/* Highlight the "View Entire Library" button */
#view-library-button.highlight {
  border: 2px solid #FFD700;   /* Gold border for emphasis */
  background-color: #444;       /* Slightly darker background (adjust as needed) */
  box-shadow: 0 0 10px #FFD700;   /* Glow effect */
}

/* Styles for the indicator badge */
.library-badge {
  display: inline-block;
  background-color: #FFD700;    /* Gold background */
  color: #000;                  /* Black text for contrast */
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 10px;
  margin-left: 5px;
}

/* ============================================
   QUICK START GUIDE - MODERN STYLING
   ============================================ */

#quickstart-guide[open] {
  opacity: 1;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  background: var(--surface, #1e1e2e);
}

#quickstart-guide .guide-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#quickstart-guide .guide-scroll-container {
  flex: 1;
  min-height: 0;
  max-height: none;
}

@keyframes guideFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  min-height: 400px;
}

.guide-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.guide-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem 0;
  background: var(--primary-accent, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.guide-progress-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.guide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff 0%, #5b9fff 100%);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.guide-progress-text {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

.guide-scroll-container {
  max-height: 580px;
  overflow-y: auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Custom scrollbar for guide */
.guide-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.guide-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.guide-scroll-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.5) 0%, rgba(91, 159, 255, 0.5) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.guide-scroll-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.7) 0%, rgba(91, 159, 255, 0.7) 100%);
  background-clip: padding-box;
}

.guide-text {
  text-align: left;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-text h3 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.guide-text p {
  margin: 0 0 1.25rem 0;
  color: rgba(255, 255, 255, 0.9);
}

.guide-text ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  list-style: none;
}

.guide-text ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.guide-text ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #00d4ff;
  font-weight: bold;
  font-size: 14px;
}

.guide-text strong {
  color: #fff;
  font-weight: 600;
}

.guide-text p strong[style*="color: Green"] {
  color: #4ade80 !important;
  font-weight: 600;
}

.guide-text p span[style*="color: Green"] {
  color: #4ade80 !important;
}

/* Pro Tip styling */
.guide-text p:has(strong[style*="color: Green"]),
.guide-text .guide-tip {
  background: rgba(74, 222, 128, 0.1);
  border-left: 3px solid #4ade80;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.guide-text .guide-tip strong {
  color: #4ade80;
}

.guide-later {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
}

.guide-later-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.guide-later-card h4 {
  margin: 0 0 0.35rem;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.guide-later-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.guide-text .guide-closer {
  margin-bottom: 0;
}

.guide-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  display: block;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.guide-image:hover {
  transform: scale(1.02);
}

/* Two-column layout for pages 2-3 */
.guide-text .guide-two-column {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  margin: 0;
}

.guide-text .guide-two-column img {
  width: 240px;
  height: auto;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

.guide-text .guide-two-column img:hover {
  transform: scale(1.03);
}

.guide-text .guide-two-column .guide-text-content {
  flex: 1;
  min-width: 0;
}

.guide-text .guide-two-column .guide-text-content h3 {
  margin-top: 0;
}

/* Navigation buttons */
.guide-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 12px 24px;
  background: var(--primary-accent, #00d4ff);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.15s ease;
  box-shadow: none;
  min-width: 100px;
}

.guide-nav-button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: var(--primary-accent-hover, #5b9fff);
}

.guide-nav-button:active:not(:disabled) {
  transform: none;
}

.guide-nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.guide-nav-button-secondary {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.guide-nav-button-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.guide-nav-icon {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .guide-later {
    grid-template-columns: 1fr;
  }

  .guide-text .guide-two-column {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .guide-text .guide-two-column img {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .guide-navigation {
    flex-wrap: wrap;
  }
  
  .guide-nav-button {
    flex: 1;
    min-width: 80px;
  }
}

.result-message {
  margin-top: 10px;
  font-size: 14px;
  color: #fff;
}

.slicer-entry {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.slicer-entry .form-group,
.slicer-entry .slicer-entry-fields {
  margin-bottom: 0.5rem;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.slicer-entry .slicer-field-label {
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

.slicer-entry .slicer-field-label + .slicer-name,
.slicer-entry .slicer-field-label + .input-with-icon {
  margin-bottom: 0.75rem;
}

.slicer-entry input {
  width: 100%;
  padding: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #444;
  color: #fff;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Text name field — do not inherit select dropdown arrow from .form-group input */
.slicer-entry input.slicer-name {
  background-image: none !important;
  padding-right: 16px !important;
  cursor: text;
}

.slicer-entry .input-with-icon {
  position: relative;
  width: 100%;
  z-index: 0;
}

.slicer-entry .input-with-icon input {
  padding: 12px 90px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
  margin-bottom: 0;
}

.slicer-entry .input-with-icon input:focus {
  outline: none;
  border-color: #00d4ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 4px 12px rgba(0, 212, 255, 0.2);
}

.slicer-entry .icon-button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 0;
}

.slicer-entry .browse-slicer-button {
  right: 44px;
  z-index: 10;
}

.slicer-entry .remove-slicer-button {
  right: 4px;
  z-index: 11;
}

.remove-slicer-button {
  color: #ff4444;
  font-size: 1.2em;
}

.remove-slicer-button:hover {
  background-color: #ff4444;
  color: white;
}

#slicer-dialog .slicer-list-actions {
  display: flex;
  gap: 8px;
  margin: 1rem 0;
}

#slicer-dialog .slicer-list-actions .full-width-button {
  flex: 1;
  width: auto;
  max-width: none;
  margin: 0;
}

#slicer-detect-status {
  margin: 0 0 0.75rem;
}

#slicer-helper-install {
  margin: 0 0 0.75rem;
}

#slicer-helper-install .full-width-button {
  margin-top: 0.5rem;
}

#detect-slicers-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

#slicer-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

/* Ensure consistent styling for virtual grid */
.file-grid {
  padding: 10px 20px; /* Small top padding to prevent menu overlap, keep horizontal */
  /* Preserve hexagon pattern background - explicitly set to ensure it works on all platforms */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l26 15v30l-26 15-26-15V15z' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3Cpath d='M0 26l30-15 30 15M0 26l30 15 30-15' fill='none' stroke='rgba(0,212,255,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  background-position: 0 0;
}

.file-grid.is-fast-scroll .file-item {
  transition: none;
}

.file-grid .file-item.virtual-grid-shell {
  transition: none;
  overflow: hidden;
  box-sizing: border-box;
}

.file-grid .file-item {
  position: relative;
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 16px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.28));
  width: 100%;
  box-sizing: border-box;
}

.file-grid .file-item:hover {
  transform: none;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
  background: var(--surface-raised, #2a2a3c);
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 55%, transparent);
}

.file-grid .file-item.selected {
  outline: 2px solid var(--primary-accent, #00d4ff);
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 12%, var(--surface, #1e1e2e));
  box-shadow: none;
}

.file-grid .thumbnail-container {
  position: relative;
  width: 100%;
  height: 250px;
  background: var(--model-background-color, #070147);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: context-menu;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.file-grid .thumbnail-container:hover {
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.2);
}

.file-grid .thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

.file-grid .file-info {
  padding: 8px 0;
  width: 100%;
  box-sizing: border-box;
}

.file-grid .file-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-grid .file-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.file-grid .metadata-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: none;
  margin-top: 8px;
}

.file-grid .metadata-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 2px 0;
  transition: all 0.2s ease;
  overflow: visible;
  width: 100%;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 0;
}

.file-grid .metadata-item.directory-item {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 0;
}

.file-grid .metadata-item.directory-item:hover {
  background: rgba(74, 158, 255, 0.1);
}

.file-grid .metadata-icon {
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.file-grid .metadata-item.designer-item .metadata-icon {
  filter: hue-rotate(240deg) saturate(1.5) brightness(1.2);
}

.file-grid .metadata-value {
  color: #ccc;
  font-weight: 400;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  max-width: 100%;
}

.file-grid .metadata-value.file-size {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.file-grid .metadata-value.directory-link {
  color: #4a9eff;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.file-grid .metadata-item.directory-item:hover .metadata-value.directory-link {
  color: #6bb3ff;
}

.file-grid .metadata-value.file-size {
  color: #aaa;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.3px;
}

.file-grid .metadata-value.designer-info {
  color: #bbb;
  font-weight: 500;
}

.file-grid .print-status {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
}

.file-grid .print-status.printed {
  background: rgba(46, 204, 113, 0.6);
}

.file-grid .archive-status {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 152, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
  z-index: 2;
}

/* New badge inside .thumbnail-container: mid-right so it never sits under the card-level Printed pill (TL).
   Avoids Archive (card TR, one line), GROUPED (::after BL in detailed/preview; TR in list), 1/N badge (BR). */
.file-grid .thumbnail-container > .new-status {
  position: absolute;
  top: 50%;
  right: 6px;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  background: rgba(52, 152, 219, 0.88);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 13;
  pointer-events: none;
  line-height: 1.2;
  white-space: nowrap;
  max-width: min(42%, calc(100% - 52px));
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* List: tiny thumb — tuck bottom-left (Printed/archive live in row columns; GROUPED is TR on thumb). */
.file-item-list .thumbnail-container > .new-status {
  top: auto;
  bottom: 2px;
  left: 2px;
  right: auto;
  transform: none;
  padding: 2px 5px;
  font-size: 9px;
  max-width: calc(100% - 6px);
}

.file-item-detailed .thumbnail-container > .new-status,
.file-item-preview .thumbnail-container > .new-status {
  right: 8px;
  max-width: min(46%, calc(100% - 56px));
}

.duplicate-group-header {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 5px;
  padding: 3px 0;
}

.duplicate-count {
  font-size: 12px;
  color: #aaa;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

#accept-terms, #decline-terms {
  width: 120px;
  padding: 8px;
  font-size: 14px;
}

/* Styles for filter pills */
.filter-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Search + tag chain: wrap within sidebar width (no horizontal overflow into main area) */
.filter-pills-search-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 8px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-bottom: 2px;
}

.filter-pills-search-chain .filter-pill,
.filter-pills-search-chain .filter-pill-search-op {
  flex-shrink: 1;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(0, 212, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 150, 200, 0.5);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  transition: all 0.3s ease;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.filter-pill.inverted {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.pill-notes-off {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-invert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.35);
  color: #ffeaea;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.filter-pill:hover {
  background: rgba(0, 212, 255, 0.25);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
}

.filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.filter-remove:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Add styles for disabled controls during loading/filtering */
.disabled-during-loading {
  opacity: 0.6;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Add overlay effect for the entire filter section during loading */
.filter-section.loading {
  position: relative;
}

.filter-section.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  z-index: 10;
  border-radius: 8px;
}

/* Add loading message overlay */
.filter-section.loading::before {
  content: "Loading Models...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  z-index: 11;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Enhance the spinner visibility */
#spinner:not(.hidden) {
  z-index: 1000;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  padding: 25px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Add styles for the progress dialog */
.progress-dialog {
  background: #242424;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 20px;
  min-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.progress-dialog h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
}

.progress-container {
  margin: 15px 0;
  padding: 15px;
  background-color: #1a1a1a;
  border-radius: 12px;
  border: 1px solid #333;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.progress-container .progress-text {
  margin-top: 4px;
  margin-bottom: 0;
  padding: 0;
  min-height: 18px;
  line-height: 1.4;
  flex-shrink: 0;
}

.progress-container progress {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 12px;
}

.progress-container progress::-webkit-progress-bar {
  background-color: #111;
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-container progress::-webkit-progress-value {
  background-color: #3498db;
  border-radius: 4px;
  background-image: linear-gradient(45deg, 
                    rgba(255, 255, 255, .15) 25%, 
                    transparent 25%, 
                    transparent 50%, 
                    rgba(255, 255, 255, .15) 50%, 
                    rgba(255, 255, 255, .15) 75%, 
                    transparent 75%, 
                    transparent);
  background-size: 20px 20px;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  from { background-position: 0 0; }
  to { background-position: 20px 0; }
}

#hash-progress-text {
  text-align: center;
  font-size: 14px;
  color: #ccc;
  background-color: #2a2a2a;
  padding: 8px;
  border-radius: 4px;
  margin-top: 0;
}

.progress-dialog .hash-progress-actions {
  justify-content: center;
  margin-top: 16px;
}

.progress-dialog .hash-progress-cancel:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Make the hash-generation-warning stand out */
.hash-generation-warning {
  margin-bottom: 15px;
}

@keyframes rotate360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotating {
  animation: rotate360 0.5s linear;
}

.refresh-button {
  font-size: 20px;
  font-weight: bold;
  color: #4a9eff;
  padding: 2px 5px;
  transition: color 0.2s, transform 0.3s;
}

.refresh-button:hover {
  color: #7bb8ff;
}

/* ===========================
   Preview Modal Styles
   =========================== */

.preview-modal {
  max-width: 94vw;
  max-height: 92vh;
  width: 1320px;
  height: 860px;
  padding: 0;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  background: var(--surface, #1e1e2e);
  overflow: hidden;
}

.preview-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1001;
}

.preview-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#preview-dialog .modal-fullscreen-icon-btn {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  box-shadow: none;
  transform: none;
}

#preview-dialog .modal-fullscreen-icon-btn:hover {
  background: rgba(74, 158, 255, 0.2);
  border-color: rgba(74, 158, 255, 0.4);
  box-shadow: none;
  transform: none;
}

#preview-dialog.modal-fullscreen {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  inset: 0;
  border-radius: 0;
}

#preview-dialog.modal-fullscreen .preview-container {
  height: 100%;
}

.preview-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  padding-right: 20px;
}

.preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.preview-stage {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.preview-canvas-container {
  flex: 1;
  position: relative;
  background: #1a1a2e;
  overflow: hidden;
  min-height: 0;
}

.preview-canvas-container.transparent-stage {
  background-color: #1a1a2e;
  background-image:
    linear-gradient(45deg, #2a2a3e 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a3e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a3e 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a3e 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

#preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-canvas-container.image-only-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f0f18;
}

.preview-image-only {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2;
  pointer-events: none;
}

.preview-image-only img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.preview-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 46, 0.95);
  z-index: 5;
  gap: 20px;
  pointer-events: none;
}

.preview-loading > * {
  pointer-events: auto;
}

.preview-loading p {
  color: #fff;
  font-size: 16px;
  margin: 0;
  white-space: pre-line;
  text-align: center;
}

.preview-controls {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  position: relative;
}

.preview-control-group {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.preview-control-button {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-width: auto;
}

.preview-control-button:hover {
  background: rgba(74, 158, 255, 0.2);
  border-color: rgba(74, 158, 255, 0.4);
  transform: translateY(-2px);
}

.preview-control-button:active {
  transform: translateY(0);
}

.preview-control-button span {
  font-size: 16px;
}

/* Global `button { display:flex }` overrides native/class hide — force Studio off for image-only types */
#preview-toggle-studio.hidden {
  display: none !important;
}

.preview-control-button.active {
  background: rgba(74, 158, 255, 0.22);
  border-color: rgba(74, 158, 255, 0.5);
}

.preview-studio-panel {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  background: rgba(16, 16, 26, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px 18px;
  color: #fff;
}

.preview-studio-panel.hidden {
  display: none;
}

.preview-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.preview-studio-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.preview-studio-panel button,
.preview-studio-chip,
.preview-studio-close,
.preview-control-button,
.preview-slicer-menu-item,
#close-preview {
  width: auto;
  max-width: none;
  margin-bottom: 0;
  box-shadow: none;
}

.preview-studio-panel button::before,
.preview-control-button::before,
.preview-slicer-menu-item::before,
#close-preview::before,
.preview-studio-close::before {
  display: none;
}

.preview-studio-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.preview-studio-close:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.4);
}

.preview-studio-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-studio-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.preview-studio-section h5 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.preview-studio-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-studio-chip {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  cursor: pointer;
}

.preview-studio-chip:hover {
  border-color: rgba(74, 158, 255, 0.4);
  background: rgba(74, 158, 255, 0.12);
}

.preview-studio-chip.active {
  background: rgba(74, 158, 255, 0.24);
  border-color: rgba(74, 158, 255, 0.55);
  color: #fff;
}

.preview-studio-slider {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.preview-studio-slider input[type="range"] {
  width: 100%;
  accent-color: #4a9eff;
}

.preview-studio-check,
.preview-studio-color {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.preview-studio-color input[type="color"] {
  width: 36px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.preview-studio-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
}

.preview-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-studio-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  cursor: pointer;
}

.preview-studio-actions button:hover {
  border-color: rgba(74, 158, 255, 0.4);
  background: rgba(74, 158, 255, 0.12);
}

.preview-studio-actions button.active {
  border-color: rgba(74, 158, 255, 0.55);
  background: rgba(74, 158, 255, 0.2);
  color: #fff;
}

.preview-canvas-container.is-picking-face #preview-canvas {
  cursor: crosshair;
}

.preview-studio-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.preview-studio-select select {
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
}

.preview-studio-select select option {
  background: #1a1a28;
  color: #fff;
}

.preview-view-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-studio-panel .preview-view-chips button {
  width: auto !important;
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 12px;
  box-shadow: none;
}

.preview-studio-panel .preview-view-chips button.active {
  background: rgba(74, 158, 255, 0.28);
  border-color: rgba(74, 158, 255, 0.6);
}

.preview-studio-panel.is-transparent .preview-studio-select:has(#preview-studio-bg),
.preview-studio-panel.is-transparent .preview-studio-select:has(#preview-studio-room),
.preview-studio-panel.is-transparent .preview-studio-select:has(#preview-studio-backdrop) {
  opacity: 0.45;
  pointer-events: none;
}

.preview-slicer-button:not(:disabled) {
  border-color: rgba(74, 158, 255, 0.35);
  background: rgba(74, 158, 255, 0.12);
}

.preview-slicer-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(74, 158, 255, 0.25);
  background: rgba(20, 24, 36, 0.95);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.preview-slicer-menu.hidden {
  display: none;
}

.preview-slicer-menu-item {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.preview-slicer-menu-item:hover {
  background: rgba(74, 158, 255, 0.2);
  border-color: rgba(74, 158, 255, 0.35);
}

.preview-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-top: 4px;
  justify-content: center;
  align-items: center;
}

.preview-part-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-part-picker.hidden {
  display: none;
}

.preview-part-picker select {
  width: auto;
  min-width: 120px;
  max-width: 220px;
  margin: 0;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
}

.preview-simplified-note {
  color: rgba(255, 200, 100, 0.9);
  font-size: 13px;
  font-style: italic;
}

.preview-instructions {
  padding: 12px 24px;
  background: rgba(74, 158, 255, 0.1);
  border-top: 1px solid rgba(74, 158, 255, 0.2);
  text-align: center;
}

.preview-instructions p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.preview-instructions strong {
  color: #4a9eff;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .preview-modal {
    width: 95vw;
    height: 85vh;
  }
}

@media (max-width: 768px) {
  .preview-studio-panel:not(.hidden) {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 8;
    width: min(300px, 86vw);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.45);
  }

  .preview-control-group {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .preview-info {
    position: static;
    transform: none;
    width: 100%;
    justify-content: center;
  }
  
  .preview-instructions {
    font-size: 12px;
  }
  
  .preview-controls {
    flex-wrap: wrap;
  }
  
  .preview-control-button {
    font-size: 13px;
    padding: 8px 16px;
  }
}

/* Manage Thumbnails Modal Styles */
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding: 8px;
  margin-top: 16px;
}

.thumbnail-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  background: var(--model-background-color);
}

.thumbnail-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.thumbnail-item.active {
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbnail-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.thumbnail-item:hover .thumbnail-item-overlay {
  opacity: 1;
}

.thumbnail-item-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  z-index: 2;
}

.thumbnail-item.active .thumbnail-item-label {
  background: rgba(0, 212, 255, 0.9);
  color: #000;
}

.thumbnail-item-button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin: 4px;
}

.thumbnail-item-button.set-active {
  background: var(--primary-accent, #00d4ff);
  color: white;
}

.thumbnail-item-button.set-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 159, 255, 0.4);
}

.thumbnail-item-button.delete {
  background: rgba(255, 59, 48, 0.9);
  color: white;
}

.thumbnail-item-button.delete:hover {
  background: rgba(255, 59, 48, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

.thumbnail-item-button.delete:disabled {
  background: rgba(128, 128, 128, 0.5);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  transform: none;
}

.thumbnail-item-button.delete:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* AND / OR / NOT toolbar under #current-filter */
.search-boolean-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 30, 46, 0.65);
  border: 1px solid rgba(137, 180, 250, 0.22);
  max-width: 100%;
  box-sizing: border-box;
}

.search-boolean-toolbar-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  margin-right: 2px;
}

.search-boolean-op-link {
  font-size: 12px;
  font-weight: 600;
  color: #89b4fa;
  text-decoration: underline;
  text-decoration-color: rgba(137, 180, 250, 0.55);
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 1px;
}

.search-boolean-op-link:hover:not([aria-disabled="true"]) {
  color: #b4befe;
  text-decoration-color: rgba(180, 190, 254, 0.95);
}

.search-boolean-op-link.disabled-during-loading,
.search-boolean-op-link[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

.search-boolean-op-sep {
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  user-select: none;
  padding: 0 2px;
}

.search-boolean-hint {
  flex: 1 1 160px;
  font-size: 11px;
  color: #fab387;
  line-height: 1.35;
  min-width: 0;
}

.filter-section.filter-section-awaiting-search {
  box-shadow: inset 0 0 0 1px rgba(250, 179, 135, 0.45);
  border-radius: 8px;
}

.filter-pill-search-op {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 10px;
  margin: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 8px;
  border: 1px solid rgba(166, 218, 149, 0.55);
  background: rgba(49, 50, 68, 0.92);
  color: #a6e3a1;
  vertical-align: middle;
}

/* Non-removable AND between search clause and tag segment (tags are not search tokens) */
.filter-pill-logic-connector {
  flex-shrink: 0;
  padding: 4px 10px;
  margin: 2px;
  cursor: default;
  user-select: none;
}

.filter-pill-tag-combine-hint {
  flex-shrink: 0;
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(200, 210, 225, 0.85);
  margin-left: 2px;
  white-space: nowrap;
}

.filter-pill-search-clause {
  max-width: 100%;
}

.filter-multi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.filter-multi-chips[hidden] {
  display: none !important;
}

.filter-value-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  border-radius: 12px;
  background: rgba(137, 180, 250, 0.2);
  border: 1px solid rgba(137, 180, 250, 0.45);
  font-size: 12px;
}

.filter-chip-remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  font-size: 14px;
  opacity: 0.85;
}

.filter-chip-remove:hover {
  opacity: 1;
}

.filter-combine-row {
  margin-top: 4px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-combine-row[hidden] {
  display: none !important;
}

.filter-combine-label {
  margin-right: 4px;
  opacity: 0.85;
}

.path-tree-label-row,
.print-history-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
}

.path-tree-label-row label,
.print-history-label-row label {
  margin-bottom: 0;
}

.path-tree-label-row .icon-button {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.folder-rail-toggle {
  width: auto;
  max-width: none;
  margin-bottom: 0;
  flex: 0 0 auto;
  align-self: center;
  padding: 10px 20px;
  background: var(--surface-raised, #2a2a3c);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
  overflow: visible;
}

.folder-rail-toggle::before {
  display: none;
}

.folder-rail-toggle:hover {
  background: color-mix(in srgb, var(--primary-accent, #00d4ff) 16%, var(--surface-raised, #2a2a3c));
  border-color: color-mix(in srgb, var(--primary-accent, #00d4ff) 45%, transparent);
  transform: none;
  box-shadow: none;
}

.folder-rail-toggle.active {
  background: var(--primary-accent, #00d4ff);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.folder-rail {
  position: fixed;
  top: 0;
  left: var(--sidebar-width, 350px);
  width: var(--folder-tree-width, 280px);
  height: 100vh;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--surface, #1e1e2e);
  border-right: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  box-shadow: none;
}

.folder-rail.hidden,
.folder-tree-popover.hidden {
  display: none;
}

body.server-mode .folder-rail {
  top: 30px;
  height: calc(100vh - 30px);
}

.folder-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.folder-rail-header .icon-button {
  width: 28px;
  height: 28px;
  margin: 0;
}

.folder-rail-header .icon-button::before {
  display: none;
}

.folder-tree-search-wrap {
  padding: 0 10px 8px;
  flex-shrink: 0;
}

.folder-tree-search-wrap input,
.folder-tree-popover > input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 12px;
}

.folder-rail-tree,
.folder-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 12px;
}

.folder-tree-popover {
  position: fixed;
  z-index: 240;
  width: var(--folder-tree-width, 280px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  border-radius: 12px;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
}

.folder-tree-popover > input {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.folder-tree-node {
  user-select: none;
}

.folder-tree-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  max-width: none;
  padding: 4px 6px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  text-align: left;
  box-shadow: none;
  overflow: visible;
  font-weight: 400;
}

.folder-tree-row::before {
  display: none;
}

.folder-tree-row:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.folder-tree-row.is-selected {
  background: rgba(0, 212, 255, 0.16);
}

.folder-tree-twist {
  width: 16px;
  flex-shrink: 0;
  opacity: 0.7;
  font-size: 10px;
}

.folder-tree-twist.is-empty {
  opacity: 0;
}

.folder-tree-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: var(--primary-accent, #00d4ff);
  -webkit-mask: var(--tree-glyph, var(--icon-bx-folder)) center / contain no-repeat;
  mask: var(--tree-glyph, var(--icon-bx-folder)) center / contain no-repeat;
}

.folder-tree-icon.is-bundle {
  --tree-glyph: var(--icon-bx-zip);
}

.folder-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tree-count {
  flex-shrink: 0;
  opacity: 0.55;
  font-size: 11px;
}

.folder-tree-children {
  margin-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 4px;
}

.sidebar .dropdown-with-list .folder-tree-button {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.panel-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: col-resize;
  z-index: 30;
  touch-action: none;
  flex: none;
}

.sidebar-resize-handle {
  position: fixed;
  top: 0;
  left: calc(var(--sidebar-width, 350px) - 8px);
  right: auto;
  bottom: auto;
  width: 8px;
  height: 100vh;
  z-index: 110;
}

body.server-mode .sidebar-resize-handle {
  top: 30px;
  height: calc(100vh - 30px);
}

.panel-resize-handle::after {
  content: '';
  position: absolute;
  top: 0;
  right: 2px;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: transparent;
  pointer-events: none;
}

.panel-resize-handle:hover::after,
.panel-resize-handle.is-active::after,
body.is-panel-resizing .panel-resize-handle.is-active::after {
  background: rgba(0, 212, 255, 0.7);
}

body.is-panel-resizing,
body.is-panel-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}