.favorites-widget {
  position: fixed;
  bottom: 80px;
  right: -320px;
  z-index: 40;
  max-width: 320px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(2,6,23,.08);
  transition: right 0.3s ease;
}
.favorites-widget.open {
  right: 20px;
}
.favorites-widget.dark {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
.favorites-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.favorites-widget.dark .favorites-widget-header {
  border-bottom-color: #334155;
}
.favorites-widget-title {
  font-size: 14px;
  font-weight: 600;
}
/* Toggle button on right edge */
.favorites-widget-toggle {
  position: fixed;
  bottom: 80px;
  right: 0;
  width: 48px;
  height: 48px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 41;
}
.favorites-widget-toggle:hover {
  background: #4f46e5;
  transform: scale(1.05);
}
.favorites-widget-toggle:active {
  transform: scale(0.95);
}
.favorites-widget-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.favorites-widget.dark .favorites-widget-toggle {
  background: #1e293b;
  border-color: #475569;
}
.favorites-widget-body {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
}
.favorites-widget-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: #f8fafc;
  transition: background 0.15s;
}
.favorites-widget.dark .favorites-widget-item {
  background: #1e293b;
}
.favorites-widget-item:hover {
  background: #e2e8f0;
}
.favorites-widget.dark .favorites-widget-item:hover {
  background: #334155;
}
.favorites-widget-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}
.favorites-widget-info {
  flex: 1;
  min-width: 0;
}
.favorites-widget-symbol {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.favorites-widget-price {
  font-size: 11px;
  color: #64748b;
}
.favorites-widget.dark .favorites-widget-price {
  color: #94a3b8;
}
.favorites-widget-change {
  font-size: 11px;
  font-weight: 600;
}
.favorites-widget-change.positive {
  color: #10b981;
}
.favorites-widget-change.negative {
  color: #ef4444;
}
.favorites-widget-remove {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #f59e0b;
  font-weight: 700;
  cursor: pointer;
}
.favorites-widget.dark .favorites-widget-remove {
  background: #0f172a;
  border-color: #475569;
}
.favorites-widget-remove:hover {
  background: #fef3c7;
}
.favorites-widget.dark .favorites-widget-remove:hover {
  background: #1e293b;
}
.favorites-widget-empty {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}
.favorites-widget.dark .favorites-widget-empty {
  color: #94a3b8;
}
.favorites-widget-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.favorites-widget-refresh {
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.favorites-widget-refresh:hover {
  background: #e2e8f0;
  transform: rotate(180deg);
}
.favorites-widget-refresh:active {
  transform: rotate(360deg);
}
.favorites-widget.dark .favorites-widget-refresh {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}
@media (max-width: 640px) {
  .favorites-widget {
    bottom: 70px;
    right: -100%;
    left: auto;
    max-width: none;
    width: calc(100% - 60px);
  }
  .favorites-widget.open {
    right: 60px;
  }
  .favorites-widget-toggle {
    bottom: 70px;
    right: 0;
    width: 44px;
    height: 44px;
  }
}
