:root {
  --bg: #131313;
  --fg: #f2f2f2;
  --muted: #b0b0b0;
  --card: #1a1a1a;
  --menu-hover: #262626;
  --border: #2a2a2a;
  --primary: #1257FD;
}

:root.light-mode {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #666666;
  --card: #f5f5f5;
  --menu-hover: #ebebeb;
  --border: #e0e0e0;
  --primary: #1257FD;
}

/* WCAG Compliance: All UI colors adhere to WCAG AA/AAA contrast standards.
   Primary color (#1257FD) with white text meets WCAG AAA for large text.
   Foreground (#f2f2f2) on background (#131313) meets WCAG AAA standards. */

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
}


/* Ensure the header container distributes space */
.header {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: space-between;
  -moz-justify-content: space-between;
  justify-content: space-between;
  padding: 12px 20px 12px 20px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: flex-end;
  -moz-align-items: flex-end;
  align-items: flex-end;
  gap: 12px;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
}

.logo {
  width: 24px;
  height: 24px;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
  color: var(--fg);
}

/* Keep the controls centered */
.controls {
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
  -moz-transform: translateX(-50%);
  transform: translateX(-50%);
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  gap: 12px;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
}

.theme-toggle-wrapper {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
}

.theme-toggle-checkbox {
  display: none;
}

.theme-toggle-label {
  width: 44px;
  height: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: flex-start;
  -moz-justify-content: flex-start;
  justify-content: flex-start;
  cursor: pointer;
  padding: 0 3px;
  transition: all 140ms ease;
  position: relative;
}

.theme-toggle-label:hover {
  border-color: var(--primary);
}

.theme-toggle-label .toggle-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  transition: transform 140ms ease;
}

.theme-toggle-checkbox:checked + .theme-toggle-label {
  background: var(--card);
  -webkit-justify-content: flex-end;
  -moz-justify-content: flex-end;
  justify-content: flex-end;
}

.theme-toggle-label .toggle-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

/* Styling for the version text */
.header-version {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 400;
  color: var(--fg);
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: 4px;
  margin-left: 0;
}

:root.light-mode .header-version {
  background: var(--card);
  opacity: 1;
}

/* Responsive fix: if screen is too small, release absolute positioning */
@media (max-width: 900px) {
  .header {
    flex-direction: column;
    gap: 16px;
  }
  .controls {
    position: static;
    transform: none;
  }
  .header-version {
    order: -1; /* Move version to top or bottom on mobile */
    align-self: flex-end;
    margin-left: 0;
  }
}

.menu-dropdown {
  position: relative;
}

.menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
  transition: all 140ms ease;
  padding: 0;
}

.menu-btn:hover {
  border-color: var(--primary);
  background: rgba(18, 87, 253, 0.08);
}

.menu-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 8px;
  padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.menu-item {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: flex-start;
  -moz-justify-content: flex-start;
  justify-content: flex-start;
  padding: 8px 16px;
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  transition: all 140ms ease;
  white-space: nowrap;
  gap: 12px;
}

.menu-item:hover {
  background: var(--menu-hover);
}

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

.menu-item-disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.menu-badge {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 400;
  color: var(--fg);
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  margin-left: 0;
  white-space: nowrap;
}

:root.light-mode .menu-badge {
  background: var(--card);
  opacity: 1;
}

.branding { margin: 0; font-size: 16px; font-weight: 400; -webkit-flex-shrink: 0; -moz-flex-shrink: 0; flex-shrink: 0; font-family: 'Poppins', system-ui, sans-serif; letter-spacing: 0.5px; }

h1 { all: inherit; }



.select-wrapper {
  position: relative;
  display: inline-block;
  width: auto;
  overflow: visible;
  border-radius: 999px;
}

.style-buttons {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  gap: 8px;
}

.style-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 140ms ease;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.style-btn:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--fg);
}

:root.light-mode .style-btn:hover {
  background: #f0f0f0;
  border-color: var(--primary);
}

.style-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.style-btn.active:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

:root.light-mode .style-btn.active:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.search-wrapper {
  position: relative;
  display: inline-block;
  overflow: visible;
  border-radius: 4px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0.6;
  z-index: 1;
  transition: opacity 140ms ease, filter 140ms ease;
}

:root.light-mode .search-icon {
  opacity: 0.8;
  filter: brightness(0.3);
}

.search-wrapper:has(input[type="search"]:focus) .search-icon,
.search-wrapper:has(input[type="search"]:not(:placeholder-shown)) .search-icon {
  opacity: 1;
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  transform: translateY(-50%);
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #1257FD;
  opacity: 0.7;
  transition: opacity 140ms ease;
  z-index: 2;
}

.clear-search-btn:hover {
  opacity: 1;
}

.clear-search-btn img {
  width: 16px;
  height: 16px;
  transition: filter 140ms ease;
}

.clear-search-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

:root.light-mode .clear-search-btn {
  opacity: 0.8;
}

input[type="search"] {
  width: 416px;
  padding: 8px 40px 8px 32px;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: all 140ms ease;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

input[type="search"]:hover {
  border-color: var(--primary);
}

input[type="search"]:not(:placeholder-shown),
input[type="search"]:focus {
  border-color: var(--primary);
  background: rgba(18, 87, 253, 0.1);
}

:root.light-mode input[type="search"]:not(:placeholder-shown),
:root.light-mode input[type="search"]:focus {
  background: rgba(18, 87, 253, 0.08);
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

select, button {
  padding: 8px 12px;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

select {
  padding-right: 32px;
  cursor: pointer;
}

button { cursor: pointer; }

.hint { display: none; margin: 12px 0 0; color: var(--muted); font-size: 12px; }

main { padding: 0; display: -webkit-flex; display: -moz-flex; display: flex; -webkit-flex-direction: column; -moz-flex-direction: column; flex-direction: column; -webkit-flex: 1; -moz-flex: 1; flex: 1; min-height: 0; }

.main-wrapper {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  gap: 0;
  position: relative;
  -webkit-flex: 1;
  -moz-flex: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.status { color: var(--muted); margin: 12px 32px 0; font-size: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  align-content: start;
  justify-items: center;
  align-items: center;
  padding: 32px 32px;
  box-sizing: border-box;
  min-width: 0;
}

.preview {
  border-radius: 4px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  background: var(--bg);
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  transition: background 140ms ease, border-color 140ms ease;
}

.preview:hover {
  background: var(--card);
  border-color: var(--primary);
}

.preview.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 87, 253, 0.1);
}

.preview.selected:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.name { display: none; font-weight: 600; font-size: 12px; }
.meta { display: none; color: var(--muted); font-size: 12px; margin-top: 4px; }

.container {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-flex: 1;
  -moz-flex: 1;
  flex: 1;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: 320px;
  padding: 20px 20px 20px 20px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
}

.sidebar-title {
  font-weight: 500;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.categories-list {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  gap: 8px;
}

.category-btn {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-justify-content: space-between;
  -moz-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
  font-size: 12px;
  transition: background 140ms ease;
}

.category-btn:hover {
  background: var(--card);
}

.category-btn.active {
  background: var(--primary);
  font-weight: 500;
  color: white;
}

.category-btn.active .category-count {
  color: white;
}

.category-count {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #2FA52D;
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.show {
  opacity: 0.92;
}
.toast-error {
  top: 20px;
  right: 20px;
  bottom: auto;
  left: auto;
  transform: translateY(-8px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 16px;
  background: #111111;
  color: #fff;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  z-index: 1200;
}
.toast-error.show {
  transform: translateY(0);
}
.toast-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 2px;
}
.toast-content {
  display: grid;
  row-gap: 6px;
}
.toast-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
}
.toast-description {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.33;
  color: rgba(255, 255, 255, 0.72);
}
.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}
.toast-close svg {
  display: block;
}

@media (max-width: 640px) {
  .toast-error {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}

/* Details Panel Styles */
.details-panel {
  width: 320px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
  transition: transform 200ms ease;
  -webkit-transform: translateX(100%);
  -moz-transform: translateX(100%);
  transform: translateX(100%);
}

.details-panel.hidden {
  -webkit-transform: translateX(100%);
  -moz-transform: translateX(100%);
  transform: translateX(100%);
  pointer-events: none;
  visibility: hidden;
}

.details-panel:not(.hidden) {
  -webkit-transform: translateX(0);
  -moz-transform: translateX(0);
  transform: translateX(0);
  will-change: transform;
}

.details-wrapper {
  padding: 20px;
}

.details-content {
  padding: 20px;
}

.icon-name {
  font-size: 12px;
  font-weight: 600;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0 0 12px 0;
  color: var(--fg);
}

.details-preview {
  margin-bottom: 8px;
}

.preview-box {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 40px;
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  aspect-ratio: 1;
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.preview-box img,
.preview-box svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.details-actions {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

.action-btn {
  -webkit-flex: 1;
  -moz-flex: 1;
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 4px;
  background: #2FA52D;
  color: #ffffff;
  font-weight: 500;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  font-size: 12px;
  transition: background 140ms ease;
}

.action-btn:hover {
  background: #27922a;
}

.details-section {
  margin-bottom: 12px;
}

#colorSection {
  display: block;
}

#colorSection[style*="display: none"] {
  display: none !important;
}

.section-label {
  font-weight: 500;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.format-buttons,
.size-buttons {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  gap: 8px;
  -webkit-flex-wrap: wrap;
  -moz-flex-wrap: wrap;
  flex-wrap: wrap;
}

.size-buttons {
  gap: 8px;
}

.panel-style-buttons {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  gap: 8px;
  -webkit-flex-wrap: wrap;
  -moz-flex-wrap: wrap;
  flex-wrap: wrap;
}

.format-btn,
.size-btn,
.panel-style-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 140ms ease;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.format-btn:hover,
.size-btn:hover,
.panel-style-btn:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--fg);
}

:root.light-mode .format-btn:hover,
:root.light-mode .size-btn:hover,
:root.light-mode .panel-style-btn:hover {
  background: #f0f0f0;
  border-color: var(--primary);
  color: var(--fg);
}

.format-btn.active,
.size-btn.active,
.panel-style-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.format-btn.active:hover,
.size-btn.active:hover,
.panel-style-btn.active:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

:root.light-mode .format-btn.active:hover,
:root.light-mode .size-btn.active:hover,
:root.light-mode .panel-style-btn.active:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.size-input {
  width: 44px;
  padding: 8px 8px;
  margin: 0;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--fg);
  outline: none;
  transition: all 140ms ease;
  cursor: text;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.size-input:invalid {
  box-shadow: none;
}

.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.size-input:hover {
  border-color: transparent;
}

.size-input:focus {
  border-color: transparent;
  background: transparent;
}

:root.light-mode .size-input:focus {
  background: transparent;
}

.size-input-wrapper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  transition: all 140ms ease;
  overflow: hidden;
}

.size-input-wrapper:hover {
  border-color: var(--primary);
}

.size-input-wrapper:has(.size-input:focus) {
  border-color: var(--primary);
  background: rgba(18, 87, 253, 0.1);
}

:root.light-mode .size-input-wrapper:has(.size-input:focus) {
  background: rgba(18, 87, 253, 0.08);
}

.size-input-wrapper .size-input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  flex: 0 0 52px;
  transition: none;
}

.size-input-wrapper .size-input:hover {
  border-color: transparent;
  background: transparent;
}

.size-input-wrapper .size-input:focus {
  border-color: transparent;
  background: transparent;
}

.size-unit {
  padding: 8px 12px;
  font-size: 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
  border-left: 1px solid var(--border);
}

.color-buttons {
  display: -webkit-flex;
  display: -moz-flex;
  display: flex;
  gap: 8px;
  -webkit-flex-wrap: wrap;
  -moz-flex-wrap: wrap;
  flex-wrap: wrap;
  width: 100%;
}

.color-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 2px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: all 140ms ease;
  position: relative;
  -webkit-appearance: none !important;
  -moz-appearance: none;
  appearance: none;
  -webkit-flex-shrink: 0;
  -moz-flex-shrink: 0;
  flex-shrink: 0;
  padding: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-clip: border-box;
  font-size: 16px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.color-btn:hover {
  border-color: var(--primary);
  -webkit-transform: scale(1.05);
  -moz-transform: scale(1.05);
  transform: scale(1.05);
}

:root.light-mode .color-btn:hover {
  border-color: var(--primary);
}

.color-btn:active,
.color-btn.active {
  border-color: var(--primary);
  -webkit-box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
  -moz-box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}

/* Safari touch target fix */
@supports (-webkit-touch-callout: none) {
  .color-btn {
    -webkit-user-select: none;
    user-select: none;
  }
  
  .color-buttons {
    display: -webkit-flex;
    display: flex;
  }
  
  #colorSection {
    display: block !important;
  }
}

/* Empty State - Icon Request Form */
.empty-state {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-flex: 1;
  -moz-flex: 1;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 20px;
  min-width: 0;
}

.grid-empty-state {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  -webkit-align-items: flex-start;
  -moz-align-items: flex-start;
  align-items: flex-start;
  padding: 40px 20px;
  width: 100%;
}

.empty-state-content {
  max-width: 500px;
  width: 100%;
  text-align: center;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.empty-state-message {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 24px 0;
}

.icon-request-form {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  width: 100%;
  max-width: 500px;
}

.form-group {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  gap: 4px;
}

.form-group-header {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  -moz-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.form-group .required::after {
  content: "*";
  color: #FF2E24;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group textarea {
  padding: 10px 12px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: all 140ms ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(18, 87, 253, 0.05);
}

.form-group input[type="text"]:read-only {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--border);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.char-count {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.reference-section {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  gap: 8px;
}

.reference-section > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}

.reference-tabs {
  display: -webkit-flex;
  display: flex;
  gap: 8px;
}

.reference-tab {
  padding: 6px 12px;
  font-size: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 140ms ease;
}

.reference-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(18, 87, 253, 0.1);
}

.reference-content {
  display: none;
}

.reference-content.active {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  gap: 12px;
}

.file-dropzone {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  padding: 24px 20px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

:root.light-mode .file-dropzone {
  border-color: var(--border);
  background: var(--card);
}

.file-dropzone:hover,
.file-dropzone.is-dragging {
  border-color: rgba(18, 87, 253, 0.65);
  background: rgba(18, 87, 253, 0.03);
}

:root.light-mode .file-dropzone:hover,
:root.light-mode .file-dropzone.is-dragging {
  border-color: rgba(18, 87, 253, 0.8);
  background: rgba(18, 87, 253, 0.02);
}

.file-dropzone:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.file-dropzone.has-file {
  border-style: solid;
}

.file-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.file-dropzone.is-disabled:hover,
.file-dropzone.is-disabled.is-dragging {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

:root.light-mode .file-dropzone.is-disabled:hover,
:root.light-mode .file-dropzone.is-disabled.is-dragging {
  border-color: var(--border);
  background: var(--card);
}

.file-dropzone-icon {
  color: var(--muted);
}

.file-dropzone-icon img {
  display: block;
  opacity: 0.55;
}

:root.light-mode .file-dropzone-icon img {
  filter: brightness(0);
  opacity: 0.32;
}

.file-dropzone-copy {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  -moz-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  gap: 2px;
}

.file-dropzone-title {
  margin: 0;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

.file-dropzone-subtitle {
  margin: 0;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.72;
}

.file-selection {
  display: -webkit-flex;
  display: flex;
  width: 100%;
}

.file-selection-grid {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  -moz-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

.file-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--bg);
  border-radius: 999px;
  background: var(--card);
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: border-color 140ms ease, background 140ms ease;
  z-index: 1;
}

.file-preview-chip:hover .file-preview-remove,
.file-preview-chip:focus-within .file-preview-remove {
  opacity: 1;
  pointer-events: auto;
}

.file-preview-remove:hover {
  border-color: var(--bg);
}

.file-preview-chip {
  position: relative;
  width: calc((100% - 64px) / 5);
  height: 64px;
  border-radius: 6px;
  overflow: visible;
}

.file-preview-thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  border: 1px solid #262626;
  object-fit: cover;
  background: var(--card);
}

.file-preview-size {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(19, 19, 19, 0.56);
  color: rgba(255, 255, 255, 0.8);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  opacity: 0;
  transition: opacity 140ms ease;
}

.file-preview-chip:hover .file-preview-size,
.file-preview-chip:focus-within .file-preview-size {
  opacity: 1;
}

:root.light-mode .file-preview-remove {
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #606060;
}

:root.light-mode .file-preview-thumb {
  border-color: #E4E4E4;
}

.file-input-link {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: opacity 140ms ease;
  display: inline;
}

.file-input-link:hover {
  opacity: 0.8;
}


.form-group input[type="file"] {
  font-size: 12px;
  cursor: pointer;
  padding: 10px 12px;
}

.form-actions {
  display: -webkit-flex;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.request-submit-btn,
.request-cancel-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 140ms ease;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.request-submit-btn {
  background: var(--primary);
  color: white;
}

.request-submit-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.request-submit-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: #4D4D4D;
  color: var(--muted);
  border: none;
}

.request-cancel-btn {
  background: transparent;
  color: var(--primary);
}

.request-cancel-btn:hover {
  background: rgba(18, 87, 253, 0.1);
}

.form-error {
  font-size: 10px;
  color: #FF2E24;
  margin-top: 4px;
}

.form-group input[type="text"]:invalid,
.form-group input[type="email"]:invalid,
.form-group input[type="url"]:invalid,
.form-group textarea:invalid {
  border-color: #FF2E24;
}

.form-group input.input-error,
.form-group textarea.input-error {
  border-color: #FF2E24;
  background: rgba(255, 46, 36, 0.05);
}

.form-group input.input-valid,
.form-group textarea.input-valid {
  border-color: #2FA52D;
  background: rgba(47, 165, 45, 0.05);
}

.request-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--muted);
  color: var(--border);
}

/* Success State */
.empty-state-success {
  text-align: center;
}

.success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  -moz-justify-content: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(18, 87, 253, 0.15);
  color: var(--primary);
  font-size: 24px;
}

.success-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px 0;
}

.success-message {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

/* Installation Modal */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.install-modal-content {
  background: var(--bg);
  color: var(--fg);
  width: min(90vw, 600px);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  overflow: hidden;
  font-family: 'Poppins', system-ui, sans-serif;
}

.install-modal-header {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.install-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.install-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  transition: all 140ms ease;
}

.install-close-btn:hover {
  background: rgba(255, 46, 36, 0.1);
  color: #FF2E24;
}

.install-modal-body {
  padding: 24px 20px;
}

.install-modal-body p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 16px;
}

.install-step {
  margin-bottom: 24px;
}

.install-step:last-child {
  margin-bottom: 0;
}

.install-step-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--fg);
}

.code-block {
  background: var(--card);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--primary);
  overflow-x: auto;
  margin-bottom: 8px;
}

.install-modal-body code {
  background: var(--card);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--fg);
  border: 1px solid var(--border);
}

.code-block code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: 12px;
  color: var(--primary);
}

.install-step p.hint {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}

.install-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: rgba(18, 87, 253, 0.08);
  border: 1px solid rgba(18, 87, 253, 0.2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.install-alert-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.install-alert-content h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.install-alert-content p {
  margin: 0;
  font-size: 12px;
  color: var(--fg-secondary);
  line-height: 1.5;
}

.install-alert-content strong {
  font-weight: 600;
  color: var(--fg);
}
