/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-search: rgba(255, 255, 255, 0.06);
  --bg-search-focus: rgba(255, 255, 255, 0.1);

  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-soft: rgba(99, 102, 241, 0.12);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --blur: 20px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ========================================
   Background
   ======================================== */
.bg-image {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 1s ease;
  opacity: 0;
}

.bg-image.loaded {
  opacity: 1;
}

/* Full-screen loading animation */
.bg-loading {
  position: fixed;
  inset: 0;
  z-index: -3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}

.bg-loading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bg-loading-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.bg-loading-ring {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loadRingSpin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}

.bg-loading-ring-2 {
  position: absolute;
  top: 0;
  width: 56px;
  height: 56px;
  border: 2px solid transparent;
  border-bottom-color: rgba(139, 92, 246, 0.6);
  border-radius: 50%;
  animation: loadRingSpin 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse;
  box-shadow: none;
}

.bg-loading-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: loadPulse 1.5s ease-in-out infinite;
}

/* Shimmer sweep across the screen */
.bg-loading-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
      transparent 40%,
      rgba(99, 102, 241, 0.03) 45%,
      rgba(99, 102, 241, 0.06) 50%,
      rgba(99, 102, 241, 0.03) 55%,
      transparent 60%);
  background-size: 200% 100%;
  animation: loadShimmer 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loadRingSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loadPulse {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

@keyframes loadShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-primary);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity var(--transition);
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.15), transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(139, 92, 246, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(59, 130, 246, 0.06), transparent 60%);
  pointer-events: none;
}

/* ========================================
   Opacity Control
   ======================================== */
.opacity-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.opacity-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 32, 0.8);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.opacity-toggle:hover {
  background: rgba(24, 24, 32, 0.95);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.opacity-slider-panel {
  background: rgba(24, 24, 32, 0.92);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.98);
  transition: var(--transition);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.opacity-slider-panel.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.opacity-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: var(--transition);
}

.opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px var(--accent-glow);
}

.opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}

.opacity-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.opacity-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
}

.opacity-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ========================================
   Container
   ======================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ========================================
   Hero / Clock
   ======================================== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
  user-select: none;
}

.clock {
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 0%, #d4d4d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.greeting {
  font-size: 1.25rem;
  color: #e4e4e7;
  margin-top: 8px;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.date {
  font-size: 0.875rem;
  color: #a1a1aa;
  margin-top: 4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 0.8rem;
  color: #d4d4d8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.weather.loaded {
  opacity: 1;
}

.weather-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.weather-temp {
  font-weight: 600;
  color: #e4e4e7;
}

.weather-sep {
  color: rgba(255, 255, 255, 0.15);
  font-weight: 300;
}

.weather-location {
  color: #a1a1aa;
}

/* ========================================
   Search
   ======================================== */
.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto 48px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(10, 10, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 4px 16px 4px 4px;
  transition: var(--transition);
  position: relative;
}

.search-box:focus-within {
  background: var(--bg-search-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.engine-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  font-family: var(--font);
}

.engine-btn:hover {
  background: var(--accent);
  color: white;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 10px 12px;
  font-family: var(--font);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font);
  pointer-events: none;
  transition: var(--transition);
}

.search-box:focus-within .search-hint {
  opacity: 0;
}

/* Engine Dropdown */
.engine-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(24, 24, 32, 0.95);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: var(--transition);
  z-index: 100;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.engine-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.engine-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: var(--transition);
  font-family: var(--font);
}

.engine-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.engine-option.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.engine-option-icon {
  font-weight: 700;
  width: 20px;
  text-align: center;
}

/* ========================================
   Bookmarks
   ======================================== */
.bookmarks {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.category {
  animation: fadeInUp 0.4s ease both;
}

.category:nth-child(2) {
  animation-delay: 50ms;
}

.category:nth-child(3) {
  animation-delay: 100ms;
}

.category:nth-child(4) {
  animation-delay: 150ms;
}

.category:nth-child(5) {
  animation-delay: 200ms;
}

.category:nth-child(6) {
  animation-delay: 250ms;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
}

.category-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.category-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.category-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Collapse indicator */
.collapse-indicator {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s ease, opacity var(--transition);
  opacity: 0;
  transform: rotate(0deg);
}

.category-header:hover .collapse-indicator {
  opacity: 1;
}

.category.collapsed .collapse-indicator {
  transform: rotate(-90deg);
  opacity: 0.7;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-bottom 0.3s ease;
  opacity: 1;
}

.category.collapsed .category-grid {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.category.collapsed .category-header {
  margin-bottom: 0;
}

/* ========================================
   Link Card
   ======================================== */
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.link-card:hover {
  background: rgba(10, 10, 15, 0.75);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.link-card:hover::before {
  opacity: 1;
}

.link-card:active {
  transform: translateY(0);
}

.link-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.link-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Fallback letter icon */
.link-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  border-radius: var(--radius-sm);
}

.link-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
}

/* ========================================
   No Results
   ======================================== */
.no-results {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .hero {
    padding: 40px 0 28px;
  }

  .clock {
    font-size: 3.5rem;
  }

  .greeting {
    font-size: 1.1rem;
  }

  .search-wrapper {
    margin-bottom: 36px;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
  }

  .link-card {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px 40px;
  }

  .clock {
    font-size: 2.8rem;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Selection
   ======================================== */
::selection {
  background: var(--accent);
  color: white;
}

/* ========================================
   Settings Button
   ======================================== */
.settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 32, 0.8);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.settings-btn:hover {
  background: rgba(24, 24, 32, 0.95);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: rotate(30deg);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #16161e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-footer-left,
.modal-footer-right {
  display: flex;
  gap: 8px;
}

.modal-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.modal-btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.modal-btn-primary:hover {
  background: #5558e6;
}

.modal-btn-secondary {
  background: none;
  color: var(--text-muted);
  border-color: var(--border);
}

.modal-btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Settings Category Section */
.settings-cat {
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  position: relative;
}

.settings-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-cat-header input {
  flex: 1;
}

/* Icon picker */
.settings-cat-icon-wrap {
  position: relative;
  flex-shrink: 0;
}

.settings-cat-icon-preview {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: var(--transition);
}

.settings-cat-icon-preview:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.settings-cat-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
}

.settings-cat-icon-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  width: 280px;
  padding: 10px;
  margin-top: 4px;
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.settings-cat-icon-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 4px;
}

.settings-emoji-grid::-webkit-scrollbar {
  width: 4px;
}

.settings-emoji-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.settings-emoji-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.settings-emoji-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.15);
}

.settings-cat-icon-url-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.settings-cat-icon-url-input {
  width: 100%;
  font-size: 0.75rem;
}

/* Category icon image in bookmarks */
.category-icon-img {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 2px;
}

.settings-cat-name-input {
  font-weight: 600;
}

.settings-cat-del {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.settings-cat-del:hover {
  opacity: 1;
}

.settings-links {
  padding: 8px 14px;
}

.settings-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-link-item:last-child {
  border-bottom: none;
}

.settings-link-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: contain;
}

.settings-favicon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}

.settings-favicon-wrap:hover {
  background: rgba(255, 255, 255, 0.08);
}

.settings-letter-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.settings-icon-popup {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  width: 220px;
  padding: 10px;
  margin-top: 4px;
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.settings-icon-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-icon-popup-btn {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-family: var(--font);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.settings-icon-popup-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.settings-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.settings-input:focus {
  border-color: var(--accent);
}

.settings-input-name {
  width: 100px;
}

.settings-input-url {
  flex: 1;
  min-width: 0;
}

.settings-link-del {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.settings-link-del:hover {
  opacity: 1;
}

.settings-add-link {
  display: block;
  width: 100%;
  padding: 7px;
  margin-top: 4px;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.settings-add-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}